|
@ -26,15 +26,21 @@ shutoff_handler() { |
|
|
ln -s / /var/run/init.lock || return |
|
|
ln -s / /var/run/init.lock || return |
|
|
|
|
|
|
|
|
# stop services |
|
|
# stop services |
|
|
/etc/rc.d/rc.shutdown 2>&1 | tee -a $LOG |
|
|
|
|
|
|
|
|
|
|
|
# TODO: killall! |
|
|
|
|
|
|
|
|
/etc/rc.d/rc.shutdown |
|
|
|
|
|
|
|
|
# unmount stuff |
|
|
# unmount stuff |
|
|
grep '^/' /proc/mounts | cut -d' ' -f2 | tac | while read x; do |
|
|
grep '^/' /proc/mounts | cut -d' ' -f2 | tac | while read x; do |
|
|
umount "$x" |
|
|
|
|
|
|
|
|
umount -r "$x" |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# kill anyone else |
|
|
|
|
|
killall5 -s TERM |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
killall5 -s KILL |
|
|
|
|
|
|
|
|
|
|
|
# an umount the rest |
|
|
|
|
|
umount -ar |
|
|
|
|
|
|
|
|
case "$1" in |
|
|
case "$1" in |
|
|
USR1) halt -f ;; |
|
|
USR1) halt -f ;; |
|
|
USR2) poweroff -f ;; |
|
|
USR2) poweroff -f ;; |
|
|