Skip to content

Commit

Permalink
Merge pull request #264 from freenas/issues/25365
Browse files Browse the repository at this point in the history
fix(rc): make sure to clean up tmp rc.conf
  • Loading branch information
vaibhav-rbs committed Aug 22, 2017
2 parents 0ab3479 + ba96971 commit 254562e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/freenas/etc/rc.conf.local
Expand Up @@ -769,9 +769,10 @@ if [ ! "${_NEWSUM}" = "${_OLDSUM}" -a ! -f "${NEED_UPDATE_SENTINEL}" ]; then
# this script possible, e.g. devd carp script
# To make it atomic generate to a tmp file first then move it.
# See #23047
tmpfile=$(/usr/bin/mktemp /var/tmp/rc.conf.XXXXXXXXX)
tmpfile=$(/usr/bin/mktemp /var/tmp/rc.conf.tmp.XXXXXXXXX)
_gen_conf > ${tmpfile}
mv ${tmpfile} ${FREENAS_RC}
rm -f /var/tmp/rc.conf.tmp.*
echo ${_NEWSUM} > ${FREENAS_CONFIG_MD5}
fi
Expand Down

0 comments on commit 254562e

Please sign in to comment.