From 9ef15b0091e7869937f91c8d2ae5f9475fbe4d70 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 2 Oct 2012 23:17:09 +0200 Subject: hostname: don't try to set before /proc is mounted No idea how I did not spot this obvious bug. [tomegun: note to self, I didn't spot the bug because it is only a problem when not booting with an initramfs...] Fixes: FS#31765 Signed-off-by: Tom Gundersen --- rc.sysinit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 458bac6..e18456e 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -14,9 +14,6 @@ fi if [[ -s /etc/hostname ]]; then HOSTNAME=$(< /etc/hostname) fi -if [[ $HOSTNAME ]]; then - echo "$HOSTNAME" >| /proc/sys/kernel/hostname -fi # don't let all the systemd tools be too verbose export SYSTEMD_LOG_LEVEL="notice" @@ -46,6 +43,11 @@ bootlogd -p /run/bootlogd.pid run_hook sysinit_start +if [[ $HOSTNAME ]]; then + stat_busy "Setting hostname: $HOSTNAME" + echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail +fi + HWCLOCK_PARAMS="--systz" if [[ $HARDWARECLOCK ]]; then -- cgit v1.2.3