Browse Source

init: enhanced umount handling on reboot/halt

0.2-maint
Alejandro Mery 16 years ago
parent
commit
56bfbdf793
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      initramfs/init.sh

+ 10
- 4
initramfs/init.sh

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

Loading…
Cancel
Save