summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2002-10-02 00:59:14 +0000
committerdd <dd@FreeBSD.org>2002-10-02 00:59:14 +0000
commit850da56a4943e81016cc035648c2f6659c4ec614 (patch)
treee8f07309beebbe0b2cd862bdc8592654f5403dd0 /etc
parente6b1ede7fbd2b3494c0d1d8de1a5c68e2c7f8d93 (diff)
downloadFreeBSD-src-850da56a4943e81016cc035648c2f6659c4ec614.zip
FreeBSD-src-850da56a4943e81016cc035648c2f6659c4ec614.tar.gz
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
Diffstat (limited to 'etc')
-rw-r--r--etc/rc7
-rw-r--r--etc/rc.d/initdiskless2
-rw-r--r--etc/rc.initdiskless2
3 files changed, 11 insertions, 0 deletions
diff --git a/etc/rc b/etc/rc
index 4e56afd..d4b30c2 100644
--- a/etc/rc
+++ b/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 ''
diff --git a/etc/rc.d/initdiskless b/etc/rc.d/initdiskless
index 38fab70..6722365 100644
--- a/etc/rc.d/initdiskless
+++ b/etc/rc.d/initdiskless
@@ -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
diff --git a/etc/rc.initdiskless b/etc/rc.initdiskless
index 38fab70..6722365 100644
--- a/etc/rc.initdiskless
+++ b/etc/rc.initdiskless
@@ -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
OpenPOWER on IntegriCloud