Thanks for the insightful suggestions Sam. I will definitely try some of them. I already have breakpoints in my shutdown script and several options to pause until a key is pressed. Currently all that my new /sbin/init script does is touch a file and then endlessly sleep. I may need to change this if I want to use a dynamically linked busybox. I run "telinit u" *after* I've done a pivot_root so I don't need to worry about overwriting the real /sbin/init even if static persistence is enabled. All of the non-RAM file systems are safely under the /aufs directory so /sbin is in tmpfs.
The breakpoints are very useful for debugging. They can also be used in the field if a user's system is not shutting down properly. AFAIK, this has never been needed. I love being able to get to a shell, after all of the non-RAM file systems have been unmounted, right before the final poweroff or reboot. Having access to all the tools you need throughout the shutdown process makes things much easier. BTW: I use the start-time of processes to find all the processes that need to be killed. Using pid is unreliable because it can wrap on 32-bit systems. They can also wrap on 64-bit systems even with /proc/kernel/pid_max set to 4194304. The start-time: cut -d" " -f22 /proc/$pid/stat is a long long unsigned int. So even with 1000 jiffies per second, it won't wrap for 6 * 10^8 years. If you use pids and they wrap then it is unlikely the shutdown will be clean. Peace, James _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox