mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 01:59:38 -04:00
In a diskless setup, rc.d/initdiskless may overwrite parts of /etc on
a per-machine or per-cluster (with different ways of expressing what's part of a cluster) basis. In order for this to be effective, rc.conf has to be reread after initdiskless is finished. Implement this by adding a hook to etc/rc which rereads rc.conf by request. This can also be implemented by renaming initdiskless to initdiskless.sh and sourcing rc.conf there manually, but it was decided that, that would be uglier than a hook in etc/rc. Developed in concert with: gordon
This commit is contained in:
parent
d427d1cc26
commit
2ca85e3d5e
3 changed files with 11 additions and 0 deletions
7
etc/rc
7
etc/rc
|
|
@ -88,6 +88,13 @@ case ${rc_ng} in
|
|||
|
||||
for _rc_elem in ${files}; do
|
||||
run_rc_script ${_rc_elem} ${_boot}
|
||||
# Local FreeBSD hack to reload the rc.conf on
|
||||
# a return status of 2
|
||||
if [ $? -eq 2 ]; then
|
||||
unset _rc_conf_loaded
|
||||
load_rc_config 'XXX'
|
||||
echo "Reloading rc.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ''
|
||||
|
|
|
|||
|
|
@ -138,3 +138,5 @@ if [ ! -e /etc/resolv.conf ]; then
|
|||
echo nameserver $ns >> /etc/resolv.conf;
|
||||
done
|
||||
fi
|
||||
|
||||
exit 2 # Tell /etc/rc to re-source rc.conf
|
||||
|
|
|
|||
|
|
@ -138,3 +138,5 @@ if [ ! -e /etc/resolv.conf ]; then
|
|||
echo nameserver $ns >> /etc/resolv.conf;
|
||||
done
|
||||
fi
|
||||
|
||||
exit 2 # Tell /etc/rc to re-source rc.conf
|
||||
|
|
|
|||
Loading…
Reference in a new issue