summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorfeld <feld@FreeBSD.org>2015-08-12 16:22:10 +0000
committerfeld <feld@FreeBSD.org>2015-08-12 16:22:10 +0000
commit5467ccf28f39f8cec36a76f664784b7a1b03a33e (patch)
tree8567aa9c38e2a47db3b6792b375b1b84f93decee /etc
parente8ba6b481727b8bd5f4848208b33286f898079bb (diff)
downloadFreeBSD-src-5467ccf28f39f8cec36a76f664784b7a1b03a33e.zip
FreeBSD-src-5467ccf28f39f8cec36a76f664784b7a1b03a33e.tar.gz
etc/rc.d/hostname: permit setting hostname if already set
Approved by: dteske Differential Revision: https://reviews.freebsd.org/D2577
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.d/hostname7
1 files changed, 2 insertions, 5 deletions
diff --git a/etc/rc.d/hostname b/etc/rc.d/hostname
index 13af220..3c239c4 100755
--- a/etc/rc.d/hostname
+++ b/etc/rc.d/hostname
@@ -39,16 +39,13 @@ stop_cmd=":"
hostname_start()
{
- # If we are not inside a jail, set the host name if it is not already set.
- # If we are inside a jail, set the host name even if it is already set,
- # but first check if it is permitted.
+ # If we are not inside a jail, set the host name.
+ # If we are inside a jail, set the host name if it is permitted.
#
if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then
return
fi
- elif [ -n "`/bin/hostname -s`" ]; then
- return
else
# If we're not in a jail and rc.conf doesn't specify a
# hostname, see if we can get one from kenv.
OpenPOWER on IntegriCloud