aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-07-13 20:16:19 +0000
committerBill Nottingham <notting@redhat.com>2006-07-13 20:16:19 +0000
commit8d0b46706e3a1ee985321847853c981dfffaeffd (patch)
tree97fcc68f8f9004a6850f323ee3632f811c34fe5e /rc.d
parent499517b152f92d1e7d1c74bf1d9171e29e261e9c (diff)
downloadinitscripts-8d0b46706e3a1ee985321847853c981dfffaeffd.tar
initscripts-8d0b46706e3a1ee985321847853c981dfffaeffd.tar.gz
initscripts-8d0b46706e3a1ee985321847853c981dfffaeffd.tar.bz2
initscripts-8d0b46706e3a1ee985321847853c981dfffaeffd.tar.xz
initscripts-8d0b46706e3a1ee985321847853c981dfffaeffd.zip
stateless updates (#197972, <law@redhat.com>)
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit43
1 files changed, 15 insertions, 28 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 4f7aaa80..adeb7b70 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -521,6 +521,19 @@ if [ "$READONLY" = "yes" ]; then
done
done
+ # In theory there should be no more than one network interface active
+ # this early in the boot process -- the one we're booting from.
+ # Use the network address to set the hostname of the client. This
+ # must be done even if we have local storage.
+ ipaddr=
+ if [ "$HOSTNAME" = "localhost" ]; then
+ ipaddr=$(ip addr show to 0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
+ if [ -n "$ipaddr" ]; then
+ eval $(ipcalc -h $ipaddr 2>/dev/null)
+ hostname ${HOSTNAME}
+ fi
+ fi
+
# Clients with read-only root filesystems may be provided with a
# place where they can place minimal amounts of persistent
# state. SSH keys or puppet certificates for example.
@@ -538,26 +551,8 @@ if [ "$READONLY" = "yes" ]; then
/bin/true
else
# No local storage was found. Make a final attempt to find
- # state on an NFS server. This code is greatly simplified by
- # a couple simple policies.
- #
- # First, the DHCP server will provide a hostname to the client
- #
- # Second, the hostname of the client is the key used to find
- # its state directory on the NFS server
-
- # In theory there should be only one network interface active
- # this early in the boot process -- the one we're booting from.
- # Get its name.
- ipaddr=
- if [ "$HOSTNAME" = "localhost" ]; then
- ipaddr=$(ip addr show to 0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
- if [ -n "$ipaddr" ]; then
- eval $(ipcalc -h $ipaddr 2>/dev/null)
- hostname ${HOSTNAME}
- fi
- fi
-
+ # state on an NFS server.
+
mount -t nfs $CLIENTSTATE/$HOSTNAME $STATE_MOUNT -o rw,nolock
if [ -d $STATE_MOUNT/etc ]; then
touch $STATE_MOUNT/files
@@ -573,14 +568,6 @@ if [ "$READONLY" = "yes" ]; then
mount -n -o bind $STATE_MOUNT/${i} ${i}
fi
done
-
- if [ -e $STATE_MOUNT/files.custom ]; then
- for i in $(grep -v "^#" $STATE_MOUNT/files.custom); do
- if [ -e $i ]; then
- mount -n -o bind $STATE_MOUNT/${i} ${i}
- fi
- done
- fi
fi
fi