svn commit: r330743 - in head: etc/rc.d share/man/man5
Jamie Gritton
jamie at FreeBSD.org
Sat Mar 10 20:13:08 UTC 2018
Author: jamie
Date: Sat Mar 10 20:13:07 2018
New Revision: 330743
URL: https://svnweb.freebsd.org/changeset/base/330743
Log:
Don't warn when the "hostname" rc variable is unset, but the hostname
is already non-empty (common in jails).
Modified:
head/etc/rc.d/hostname
head/share/man/man5/rc.conf.5
Modified: head/etc/rc.d/hostname
==============================================================================
--- head/etc/rc.d/hostname Sat Mar 10 18:07:31 2018 (r330742)
+++ head/etc/rc.d/hostname Sat Mar 10 20:13:07 2018 (r330743)
@@ -60,9 +60,11 @@ hostname_start()
# Have we got a hostname yet?
#
if [ -z "${hostname}" ]; then
- # Null hostname is probably OK if DHCP is in use.
+ # Null hostname is probably OK if DHCP is in use,
+ # or when hostname is already set (common for jails).
#
- if [ -z "`list_net_interfaces dhcp`" ]; then
+ if [ -z "`list_net_interfaces dhcp`" -a \
+ -z "`/bin/hostname`" ]; then
warn "\$hostname is not set -- see rc.conf(5)."
fi
return
Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5 Sat Mar 10 18:07:31 2018 (r330742)
+++ head/share/man/man5/rc.conf.5 Sat Mar 10 20:13:07 2018 (r330743)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 15, 2018
+.Dd March 10, 2018
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -421,6 +421,9 @@ If
.Xr dhclient 8
is used to set the hostname via DHCP,
this variable should be set to an empty string.
+Within a
+.Xr jail 8
+the hostname is generally already set and this variable may absent.
If this value remains unset when the system is done booting
your console login will display the default hostname of
.Dq Amnesiac .
More information about the svn-src-head
mailing list