[Pkg-sysvinit-devel] Bug#628140: initscripts: /etc/init.d/hostname.sh fails if /etc/hostname not present

Josh Triplett josh at joshtriplett.org
Mon May 30 20:13:28 UTC 2011


On Sat, May 28, 2011 at 06:53:11PM +1000, Kel Modderman wrote:
> On Sat, 28 May 2011 12:52:45 AM Edgar Fuss wrote:
> > Package: initscripts
> > Version: 2.88dsf-13.1
> > Severity: normal
> > Tags: patch
> > 
> > If /etc/hostname is not present, /etc/init.d/hostname.sh will pick up the
> > kernel supplied hostname ``(none)'' and try to set this via hostname(1),
> > wich fails. The obvious fix is to treat a hostname of ``(none)'' as, ehm,
> > none, e.g. empty. This will give you a hostname of ``localhost''.
> 
> I tend to agree that `localhost' makes more sense than `(none)' in the 
> fallback case, but I'm not sure this is the correct place to change this.
> 
> A search led me to: lkml.org/lkml/2011/4/11/14
> 
> What do you think about this? If the discussion there leads us to believe the 
> kernel is the correct place for this bug to be fixed, this bug should be 
> reassigned.

Upstream didn't care for the patch that changed the default, but I plan
to try again with a patch that makes the default configurable, which
would then allow the Debian kernel to set CONFIG_DEFAULT_HOSTNAME or
similar.

On a different note, though, it doesn't make sense to get the hostname
from the kernel and immediately try to set it in the kernel, regardless
of its value.

- Josh Triplett



More information about the Pkg-sysvinit-devel mailing list