Debian Bug report logs - #406366
ltsp-build-client: /etc/hostname breaks automatic hostname configuration

version graph

Package: ltsp-server; Maintainer for ltsp-server is Debian LTSP Maintainers <team+ltsp@tracker.debian.org>; Source for ltsp-server is src:ltsp (PTS, buildd, popcon).

Reported by: Damyan Ivanov <dam@modsoftsys.com>

Date: Wed, 10 Jan 2007 19:03:02 UTC

Severity: important

Found in version ltsp/0.99debian9

Fixed in version ltsp/5.0.27debian1

Done: Vagrant Cascadian <vagrant@freegeek.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#406366; Package ltsp-server. (full text, mbox, link).


Acknowledgement sent to Damyan Ivanov <dam@modsoftsys.com>:
New Bug report received and forwarded. Copy sent to LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Damyan Ivanov <dam@modsoftsys.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ltsp-build-client: /etc/hostname breaks automatic hostname configuration
Date: Wed, 10 Jan 2007 17:10:48 +0200
Package: ltsp-server
Version: 0.99debian9
Severity: normal

Hi,

First thing - first, LTSP rocks! debian packages install streamlined
and I am really impressed (coming from lessdisks).

There is one small glitch that ate me a couple of hours to figure today.

After ltsp-build-client, the ltsp chroot's etc/hostname contains 'ltsp'.
This causes DHCP-supplied hostname to be ignored, making client
configuration via lts.conf impossible (using hostnames; it works with
IP/MAC addresses).

Please remove /etc/hostname from client's chroot after setting it up.


Thanks for considering,
    dam

-- Package-specific info:

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-686
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)

Versions of packages ltsp-server depends on:
ii  atftpd                      0.7.dfsg-1   advanced TFTP server
ii  debconf [debconf-2.0]       1.5.11       Debian configuration management sy
ii  debconf-utils               1.5.11       debconf utilities
ii  debootstrap                 0.3.3.1      Bootstrap a basic Debian system
ii  esound-clients              0.2.36-3     Enlightened Sound Daemon - clients
ii  gettext-base                0.16.1-1     GNU Internationalization utilities
ii  iproute                     20061002-3   Professional tools to control the 
ii  lsb-release                 3.1-22       Linux Standard Base version report
ii  nfs-kernel-server           1:1.0.10-4   Kernel NFS server support
ii  openbsd-inetd [inet-superse 0.20050402-3 The OpenBSD Internet Superserver
ii  openssh-client              1:4.3p2-8    Secure shell client, an rlogin/rsh
ii  python                      2.4.4-2      An interactive high-level object-o
ii  ssh                         1:4.3p2-8    Secure shell client and server (tr
ii  tcpd                        7.6.dbs-11   Wietse Venema's TCP wrapper utilit
ii  update-inetd                4.27-0.2     inetd.conf updater

Versions of packages ltsp-server recommends:
ii  nbd-server                    1:2.8.7-2  the Network Block Device server
ii  openssh-server                1:4.3p2-8  Secure shell server, an rshd repla
ii  ssh                           1:4.3p2-8  Secure shell client and server (tr

-- debconf information:
  ltsp-server/build_client: false



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#406366; Package ltsp-server. (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@freegeek.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #10 received at 406366@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@freegeek.org>
To: Damyan Ivanov <dam@modsoftsys.com>, 406366@bugs.debian.org
Subject: Re: Bug#406366: ltsp-build-client: /etc/hostname breaks automatic hostname configuration
Date: Fri, 19 Jan 2007 23:53:32 -0800
severity 406366 important
thanks

On Wed, Jan 10, 2007 at 05:10:48PM +0200, Damyan Ivanov wrote:
> First thing - first, LTSP rocks! debian packages install streamlined
> and I am really impressed (coming from lessdisks).

as both the author of lessdisks and some code in ltsp, i'm glad to hear
it. :)

> There is one small glitch that ate me a couple of hours to figure today.
> 
> After ltsp-build-client, the ltsp chroot's etc/hostname contains 'ltsp'.
> This causes DHCP-supplied hostname to be ignored, making client
> configuration via lts.conf impossible (using hostnames; it works with
> IP/MAC addresses).

yes, we include a file there, so that it can be over-written with the
proper hostname, however we have not yet implemented any way to
configure /etc/hostname...

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... but it
should support all of the usual configuration methods (hostname/IP/MAC),
so i raised the bug severity to important.

> Please remove /etc/hostname from client's chroot after setting it up.

does removing /etc/hostname actually cause hostnames to get configured
properly?

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

thanks for the feedback.

live well,
  vagrant



Severity set to `important' from `normal' Request was from Vagrant Cascadian <vagrant@freegeek.org> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#406366; Package ltsp-server. (full text, mbox, link).


Acknowledgement sent to Damyan Ivanov <dam@modsoftsys.com>:
Extra info received and forwarded to list. Copy sent to LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #17 received at 406366@bugs.debian.org (full text, mbox, reply):

From: Damyan Ivanov <dam@modsoftsys.com>
To: Vagrant Cascadian <vagrant@freegeek.org>
Cc: 406366@bugs.debian.org
Subject: Re: Bug#406366: ltsp-build-client: /etc/hostname breaks automatic hostname configuration
Date: Sat, 20 Jan 2007 12:02:38 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- -=| Vagrant Cascadian, 20.01.2007 09:53 |=-
> On Wed, Jan 10, 2007 at 05:10:48PM +0200, Damyan Ivanov wrote:
>> After ltsp-build-client, the ltsp chroot's etc/hostname contains 'ltsp'.
>> This causes DHCP-supplied hostname to be ignored, making client
>> configuration via lts.conf impossible (using hostnames; it works with
>> IP/MAC addresses).
> 
> yes, we include a file there, so that it can be over-written with the
> proper hostname, however we have not yet implemented any way to
> configure /etc/hostname...

More on this mater below...

> 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)

>> 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.

> 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.

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,
or 2) we forget about /etc/hostname altogether and only set the kernel's
host name to 'ltsp' if it is not set.

Both approaches would require adding an rc script in the chroot, though...


Thank you for taking care,
	dam
- --
Damyan Ivanov                           Modular Software Systems
dam@modsoftsys.com
phone +359(2)928-2611, 929-3993              fax +359(2)920-0994
mobile +359(88)856-6067             dam@jabber.minus273.org/Gaim

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFsei+Hqjlqpcl9jsRAonWAKDMbQaC7MaEXdOD2w3CVpkdcmld2QCfVUug
1QHLMjTsh5rE/TpFwQNz4QU=
=1DJ6
-----END PGP SIGNATURE-----



Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#406366; Package ltsp-server. (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@freegeek.org>:
Extra info received and forwarded to list. Copy sent to LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #22 received at 406366@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@freegeek.org>
To: Damyan Ivanov <dam@modsoftsys.com>
Cc: 406366@bugs.debian.org
Subject: Re: Bug#406366: ltsp-build-client: /etc/hostname breaks automatic hostname configuration
Date: Sat, 20 Jan 2007 16:12:21 -0800
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



Blocking bugs of 418142 added: 406366 Request was from vagrant@freegeek.org to control@bugs.debian.org. (Mon, 09 Apr 2007 17:21:09 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>:
Bug#406366; Package ltsp-server. (full text, mbox, link).


Acknowledgement sent to vagrant@freegeek.org:
Extra info received and forwarded to list. Copy sent to LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #29 received at 406366@bugs.debian.org (full text, mbox, reply):

From: vagrant@freegeek.org
To: 406366@bugs.debian.org
Subject: #406366: ltsp-build-client: /etc/hostname breaks automatic hostname configuration
Date: Sat, 1 Sep 2007 22:36:35 -0700
tags 406366 pending
tags 418142 pending
thanks

so, finally figured out how to fix this one:

=== added directory 'client/initramfs/scripts'
=== added directory 'client/initramfs/scripts/nfs-bottom'
=== added file 'client/initramfs/scripts/nfs-bottom/ltsp'
--- client/initramfs/scripts/nfs-bottom/ltsp	1970-01-01 00:00:00 +0000
+++ client/initramfs/scripts/nfs-bottom/ltsp	2007-09-02 05:23:24 +0000
@@ -0,0 +1,6 @@
+# set hostname to ltsp if none is received from dhcp
+while read HOSTNAME; do
+    if [ "${HOSTNAME}" = "(none)" ]; then
+        echo "ltsp" > /proc/sys/kernel/hostname
+    fi
+done < /proc/sys/kernel/hostname

=== modified file 'debian/ltsp-client-core.install'
--- debian/ltsp-client-core.install	2007-05-28 17:16:06 +0000
+++ debian/ltsp-client-core.install	2007-09-02 04:48:34 +0000
@@ -8,6 +8,7 @@
 client/getltscfg/getltscfg usr/bin
 client/initramfs/init-bottom/unionfs_cow usr/share/ltsp-client
 client/initramfs/hooks/ltsp_client usr/share/initramfs-tools/hooks
+client/initramfs/scripts/nfs-bottom/ltsp usr/share/initramfs-tools/scripts/nfs-bottom
 client/initramfs/conf.d/ltsp usr/share/initramfs-tools/conf.d
 client/update-kernels usr/lib/ltsp
 client/jetpipe/jetpipe  usr/sbin

=== modified file 'server/plugins/ltsp-build-client/Debian/010-etc-hostname'
--- server/plugins/ltsp-build-client/Debian/010-etc-hostname	2007-05-19 14:34:09 +0000
+++ server/plugins/ltsp-build-client/Debian/010-etc-hostname	2007-09-02 04:47:38 +0000
@@ -1,5 +1,7 @@
 case "$MODE" in
     after-install)
-        echo ltsp > $ROOT/etc/hostname
+        # zero out the hostname file, so system hostname gotten from DHCP takes
+        # priority.
+        echo > $ROOT/etc/hostname
         ;;
 esac


committed to bzr branch:

  http://llama.freegeek.org/~vagrant/bzr/ltsp/vagrant-main

thanks to scotty for the /proc/sys/kernel/hostname idea, not to mention
the slick code without calling any external programs... :)

live well,
  vagrant



Tags added: pending Request was from vagrant@freegeek.org to control@bugs.debian.org. (Sun, 02 Sep 2007 05:39:04 GMT) (full text, mbox, link).


Reply sent to Vagrant Cascadian <vagrant@freegeek.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Damyan Ivanov <dam@modsoftsys.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #36 received at 406366-close@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@freegeek.org>
To: 406366-close@bugs.debian.org
Subject: Bug#406366: fixed in ltsp 5.0.27debian1
Date: Tue, 11 Sep 2007 11:02:02 +0000
Source: ltsp
Source-Version: 5.0.27debian1

We believe that the bug you reported is fixed in the latest version of
ltsp, which is due to be installed in the Debian FTP archive:

ldm_5.0.27debian1_i386.deb
  to pool/main/l/ltsp/ldm_5.0.27debian1_i386.deb
ltsp-client-builder_5.0.27debian1_all.udeb
  to pool/main/l/ltsp/ltsp-client-builder_5.0.27debian1_all.udeb
ltsp-client-core_5.0.27debian1_i386.deb
  to pool/main/l/ltsp/ltsp-client-core_5.0.27debian1_i386.deb
ltsp-client_5.0.27debian1_all.deb
  to pool/main/l/ltsp/ltsp-client_5.0.27debian1_all.deb
ltsp-server-standalone_5.0.27debian1_all.deb
  to pool/main/l/ltsp/ltsp-server-standalone_5.0.27debian1_all.deb
ltsp-server_5.0.27debian1_all.deb
  to pool/main/l/ltsp/ltsp-server_5.0.27debian1_all.deb
ltsp_5.0.27debian1.dsc
  to pool/main/l/ltsp/ltsp_5.0.27debian1.dsc
ltsp_5.0.27debian1.tar.gz
  to pool/main/l/ltsp/ltsp_5.0.27debian1.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 406366@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Vagrant Cascadian <vagrant@freegeek.org> (supplier of updated ltsp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 10 Sep 2007 14:30:30 -0700
Source: ltsp
Binary: ltsp-client-core ltsp-server ltsp-server-standalone ltsp-client ltsp-client-builder ldm
Architecture: source all i386
Version: 5.0.27debian1
Distribution: unstable
Urgency: low
Maintainer: LTSP Debian/Ubuntu Maintainers <pkg-ltsp-devel@lists.alioth.debian.org>
Changed-By: Vagrant Cascadian <vagrant@freegeek.org>
Description: 
 ldm        - LTSP display manager
 ltsp-client - LTSP client environment
 ltsp-client-builder - build an LTSP environment in the installer target (udeb)
 ltsp-client-core - LTSP client environment
 ltsp-server - basic LTSP server environment
 ltsp-server-standalone - complete LTSP server environment
Closes: 406366 418142 422962 432708 437540
Changes: 
 ltsp (5.0.27debian1) unstable; urgency=low
 .
   * remove -s from LDFLAGS: don't strip getltscfg (Closes: #437540)
     thanks to Julien Danjou
   * set default hostname in the initramfs (Closes: #406366, #418142)
     thanks to Damyan Ivanov and Joshua Pritikin
   * add versioned dependency on nbd-server
   * detect root_write_method instead of hard-coding it
   * new plugin to copy *.deb from /var/cache/apt/archives
   * updated swap documentation (Closes: #422962)
   * fix to locale plugin setting keyboard properly
   * fix typo in ltsp-client-setup init that broke syslog handling
   * drop dependency on xdebconfigurator
   * updated suggests for ltsp-server
 .
   * sync with ubuntu:
     - ltsp-client-core dependencies:
       + added console-setup, libasound2-plugins, tftp-hpa dependencies
 .
     - ltsp-server dependencies:
       + added squashfs-tools dependencies
 .
     - ldm rewrite:
       + drop dependency on python packages
       + includes gettext support (Closes: #432708)
         thanks to Petter Reinholdtsen
 .
     - ltsp-build-client plugins:
       + kiosk plugin inspired by ubuntu kiosk plugin
       + create a default lts.conf
       + link to default-modules plugin from Ubuntu
       + link to copy-timezone plugin from ubuntu
       + link to var-lib-nfs plugin from Ubuntu
       + copy console-setup if present
 .
   * get configure-x.sh working with debian:
     - set default color depth in lts.conf
     - copy and delete generated xorg.conf instead of moving it
     - add -novtswitch option when configuring X
 .
   * rename ltsp-nbd script to ltsp_nbd (needed for initramfs-tools)
   * only copy /etc/timezone if present
   * only install ldm theme for Debian
 .
   * merge with scotts-gutsy:
       - ltsp-update-image now safe to run when not building images
       - simplified screen_session
         + ignore entries on SCREEN_01
         + re-add support for /etc/ltsp/screen.d
       - use /bin/sh instead of /bin/bash in screen scripts
       - don't use full paths when calling binaries in telenet screen script
 .
   * merge fix from gutsy-ltsp to create fifo with mknod in udeb
Files: 
 0d1da824525585d46669c367b7adb5bf 975 misc extra ltsp_5.0.27debian1.dsc
 672c6d4c0dfadfbfdb317ca38c2576d2 2466731 misc extra ltsp_5.0.27debian1.tar.gz
 b8c53356163467df89050ff726efac17 78096 misc extra ltsp-server_5.0.27debian1_all.deb
 5ccfa621349e7fd6d1b304a3244fb793 35494 misc extra ltsp-server-standalone_5.0.27debian1_all.deb
 eb83e9c33d1c8ccef61f2dc7f6b62878 34572 misc extra ltsp-client_5.0.27debian1_all.deb
 82af125e5a0910674ae6533b2aa81bfb 6572 debian-installer extra ltsp-client-builder_5.0.27debian1_all.udeb
 ff34ef4682d61744612bc042188d217b 68664 misc extra ltsp-client-core_5.0.27debian1_i386.deb
 248386c4b0eac7f77564ea2e6443fe74 262558 misc extra ldm_5.0.27debian1_i386.deb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG5fIKLqiZQEml+FURAv57AJ9yIEhaOHGNjYq/ah4S8QFqp98GaACgskPc
7BCWVG73JqAchMzOl9ca8SA=
=Q7fe
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 26 Dec 2007 07:33:05 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 13:32:45 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.