aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/rc.sysinit3
-rw-r--r--sysconfig.txt1
-rwxr-xr-xsystemd/fedora-configure1
3 files changed, 5 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 6067ea88..561e99e8 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -12,6 +12,9 @@ set -m
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
fi
+if [ -r /etc/hostname ]; then
+ HOSTNAME=$(cat /etc/hostname)
+fi
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
HOSTNAME=localhost
fi
diff --git a/sysconfig.txt b/sysconfig.txt
index 58a37e1a..6a3c3b57 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -186,6 +186,7 @@ Generic options:
NETWORKING=yes|no
HOSTNAME=<fqdn by default, but whatever hostname you want>
+ Note that this can be overriden by /etc/hostname.
GATEWAY=<gateway IP>
GATEWAYDEV=<gateway device to use, when multiple devices have GATEWAY=> (e.g. eth0)
NISDOMAIN=<nis domain name>
diff --git a/systemd/fedora-configure b/systemd/fedora-configure
index e6779fed..d1e4dbd3 100755
--- a/systemd/fedora-configure
+++ b/systemd/fedora-configure
@@ -15,6 +15,7 @@ fi
# Reread in network configuration data.
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
+ [ -r /etc/hostname ] && HOSTNAME=$(cat /etc/hostname)
# Reset the hostname.
action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME}