[Pkg-ltsp-devel] Bug#483760: ltsp-client: Generate unique hostname when reverse DNS lookup fail

Άλκης Άλκης
Sun Dec 14 10:00:27 UTC 2008


Another proposed implementation, based on the client IP:

if [ "${HOSTNAME}" = "(none)" ]; then
  . /tmp/net-*.conf
# this should be all in one line:
  echo "$IPV4ADDR.$IPV4NETMASK" | awk -F "." '{ print "ltsp" 
   (($1%(256-$5)*256+$2%(256-$6))*256+$3%(256-$7))*256+$4%(256-$8) }'
   > /proc/sys/kernel/hostname
fi

The calculations are to take into account only the part of the IP that
has zeroes on the respective subnet mask bits. The end result is that
the clients are numbered from ltsp0 to ltsp(#maxclients-1).

In my opinion, those 2 proposed implementations (mac and ip based) are
simple enough and cover most of the needs.
So one of them could be the default, and the other one could be selected
based on some lts.conf entry.

Cheers,
Alkis Georgopoulos






More information about the Pkg-ltsp-devel mailing list