diff options
author | Tom Gundersen <teg@jklm.no> | 2011-10-19 10:06:35 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2011-12-27 16:01:22 +0100 |
commit | 0724c1d8aa760f02190c7ee325274f0d0957943e (patch) | |
tree | 5bb5e4193ffbd52974ad0689dcc4f2e38f9978ec /rc.sysinit | |
parent | b4ef9040c72235d2e863dcd6b699c08f9b1a0cce (diff) |
config: add /etc/hostname support
If /etc/hostname is non-empty its contents is assumed to be the hostname.
This takes precedence over HOSTNAME in rc.conf.
This implements FS#27732 and http://0pointer.de/public/systemd-man/hostname.html,
and is the same as what is done on Debian, Ubuntu, Fedora and Suse.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -225,6 +225,9 @@ RANDOM_SEED=/var/lib/misc/random-seed # Remove leftover files remove_leftover +if [[ -s /etc/hostname ]]; then + HOSTNAME=$(< /etc/hostname) +fi if [[ $HOSTNAME ]]; then stat_busy "Setting Hostname: $HOSTNAME" echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail |