From: Skip G. <sg...@at...> - 2002-07-16 12:19:54
|
Hi Folks, About 6 months ago I started developing a PowerPC version of=20 the LTSP, which meant everything needed to be recompiled.=20 My clients are 40 MB, 66 Mhz PowerPCs, so I was interested=20 in anything I could do to keep the footprint down. Early on, I discovered the RAMDISK wasn't being freed up in=20 rc.local. I discovered the reason was that the dhclient=20 process had the leases file open, so I wrote some code to=20 get the pid of the dhclient process and kill it. I could=20 then release memory allocated to the RAMDISK. I then restarted the dhclient process, and that's where the=20 fun started: In restarting the dhclient process, I created=20 a memory leak, which rendered the systems unusable after=20 about 5-6 hours. Now that I understand what's causing the=20 memory leak, I'd like to propose that the clients do not=20 need to run dhclient after they have started the network.=20 The IP addresses are statically assigned, so they should=20 not need to be renewed. The network cannot be shutdown and=20 restarted without losing the root filesystem. So, in rc.local, I propose we kill the dhclient process=20 before we try to free the RAMDISK. Sample code is attached: ********************************************************************** echo "Setting up tmpfs on /tmp" mount tmpfs /tmp -t shm -o size=3D1m,rw # # we need to kill dhclient before we can free the RAMDRIVE # PID=3D`ps -ae|grep dhclient|head -n 1 -|cut -c 1-5` kill -9 $PID # Here I create the directory structure on /tmp # Free up the initrd umount /oldroot ********************************************************************** --Skip |