[Pkg-ltsp-devel] Bug#406366: ltsp-build-client: /etc/hostname breaks automatic hostname configuration

Vagrant Cascadian vagrant at freegeek.org
Sun Jan 21 00:12:21 UTC 2007


On Sat, Jan 20, 2007 at 12:02:38PM +0200, Damyan Ivanov wrote:
> - -=| Vagrant Cascadian, 20.01.2007 09:53 |=-
> > On Wed, Jan 10, 2007 at 05:10:48PM +0200, Damyan Ivanov wrote:
> > i generally prefer to use mac addresses in lts.conf, so i only have to
> > edit one configuration file to configure a new thin-client...
> 
> Hmm. This makes sense, yes. I guess I just prefer to refer to PCs by
> name. Also, I use some features that require DNS support so the hostname
> is mandatory. (making gdm allow machine "hoho" be able to log in as user
> "hoho" without supplying a password)

sure, i can understand that. we mostly try to set up the defaults so it
requires no lts.conf at all, but for some setups this sort of thing
would be needed, and much easier to remember hostnames than mac
addresses. though i think you can include comments in lts.conf, where
you could put the hostname... but then you're maintaining hostnames in
two places ...
 
> >> Please remove /etc/hostname from client's chroot after setting it up.
> > 
> > does removing /etc/hostname actually cause hostnames to get configured
> > properly?
> 
> Yes. The kernel uses the name taken from DHCP and the
> /etc/init.d/hostname script does nothing without /etc/hostname. So
> `hostname', which takes its data from the kernel gives the host name
> from DHCP too, making it all fit together.
 
looking at /etc/init.d/hostname.sh it looks like if /etc/hostname is
present, but contains nothing, it behaves the way you want, too.  i
would prefer to do it that way, as it requires less tinkering...

the problem is, when DHCP/DNS doesn't give a hostname, you end up with
"(none)" for a hostname if it is blank.

> > you can install a plugin in /etc/ltsp/plugins/ltsp-build-client/XXX-FOO
> > to remove it after installation, if you want that behavior. see the
> > documentation for plugins in /usr/share/doc/ltsp-server/plugins
 
> I want to propose to add a plugin to the default installation that puts
> the hostname from the kernel (if present) into /etc/hostname. If there
> was no host name in the DHCP announce, it may use 'ltsp' as now.

sounds fairly sane...
 
> Problem (now) is that /etc/hostname is not writeable, so we either:
> 1) make /etc/hostname a symlink to writeable area and fill it up before
> /etc/init.d/hostname is run in case kernel already has a hostname,

rather than symlink it, i would prefer to add it to bindfiles in
/etc/default/ltsp-client-setup

> or 2) we forget about /etc/hostname altogether and only set the kernel's
> host name to 'ltsp' if it is not set.

yes, this is also possible.
 
> Both approaches would require adding an rc script in the chroot, though...

but yes, we'd have to figure out a way to handle it very early on.

i'll experiment with this a little and see what i can come up with.

live well,
  vagrant




More information about the Pkg-ltsp-devel mailing list