Thin Client /etc/hosts entry

M Rathburn stretchem at gmail.com
Wed Jan 14 20:47:52 GMT 2009


> Hi,
> 
> On Mon, 12 Jan 2009, M Rathburn wrote:
> 
> > How do I make entries into the /etc/hosts for PXE i386 thin 
> clients?  
> > I noticed that when I chrooted and tried to edit the file, it shows:
> > 
> > #This is a ltsp chroot and this file will be rewritten in 
> boot process 
> > #of terminal.
> > 127.0.0.1 localhost
> > 
> > So where would I make the entries so they'll propagate to the TC's?
> 
> A while back I used ltsp to network boot a bunch of servers.  
> I created a file called
> 
> 	/etc/init.d/customise_client
> 
> made it executable and linked it into /etc/rc2.d/ so the 
> script ran on boot.
> 
> The script did a bunch of things like:
> 
> 	echo "w.x.y.z   hostname1" >> /etc/hosts 
> 	echo "w.x.y.z   hostname2" >> /etc/hosts 
> 	echo "w.x.y.z   hostname3" >> /etc/hosts 
> 
> It also ran something like:
> 
> 	mac=`ip addr show eth0 | grep 'link/ether' | cut -f 6 -d " "`
> 
> to identify the machine by their mac address, then I had a 
> case statement which compared $mac to a bunch of known macs 
> and made machine-specific customisations.
> 
> This (particularly the machine-specific bit) is not very 
> scalable and not very pretty, but it suited my purpose.
> 
> Gavin

This works perfectly Gavin!  Thanks!

sudo chroot /opt/ltsp/i386
sudo vi /etc/init.d/customize_clients
i
echo "192.168.1.36 portal.childrenfirstflorida.org" >> /etc/hosts
ZZ
sudo chmod 755 /etc/init.d/customize_clients
sudo ln -s ../init.d/customize_clients /etc/rc2.d/S99customize_clients
exit
sudo ltsp-update-image --arch i386




More information about the edubuntu-users mailing list