Folks,

I'm working with running a Mac PowerPC as an LTSP client. On the Mac, the 
initrd needs to be a tad bigger (8 MB) than it does for the i386 client. 
Because I'm also dealing with memory-challenged Macs (40 MB) freeing the 
ramdrive was important.

The code in the current rc.local script fails to release the drive, and the 
reason is that the dhclient process has a file open on the drive. I'm not an 
expert, so perhaps this is just an anomaly of running the client on a PPC.

To release the drive, one needs to kill the dhclient before unmounting the 
initrd, and then restart the dhclient process on the new filesystem. 
Here's one way to accomplish this:

[/opt/ltsp/ppc/etc/rc.local]
...
# Start of FIX
# This occurs after we have initialised the local /tmp RAMDRIVE

# Get the PID of the dhclient process
PID=$(ps -ae | grep dhclient | head -n 1 - | cut -c 1-5)
kill -9 $PID

#
# We have two ramdisks now. we need to copy the lease imfo from the old
# RAMDRIVE to the new one, so we can free up the old one.
#
mkdir -p /tmp/var/state/dhcp
cp /oldroot/var/state/dhcp/dhclient.leases /tmp/var/state/dhcp

umount /oldroot
dhclient -sf /etc/dhclient-script \
            -cf /etc/dhclient.conf \
            -lf /tmp/var/state/dhcp/dhclient.leases eth0 1>/tmp/junk 2>&1

# End of FIX

pr_set 70 "Setting Hostname"

This also should address the issue of the dhclient not renewing the lease 
properly.

Thanks,
Skip

_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.openprojects.net

Reply via email to