/init/mountall-shell.conf

http://github.com/brinkman83/bashrc · Config · 49 lines · 43 code · 6 blank · 0 comment · 0 complexity · aa05af89db3de044d1cd7f6971b46d9f MD5 · raw file

  1. # mountall-shell - Recovery shell for filesystem failure
  2. #
  3. # If mountall exits to indicate that manual recovery is required, this
  4. # starts the necessary shell.
  5. description "Recovery shell for filesystem failure"
  6. start on (stopped mountall EXIT_STATUS=[!4]
  7. or stopped mountall EXIT_SIGNAL=?*)
  8. stop on runlevel [06]
  9. task
  10. console owner
  11. script
  12. case "$EXIT_STATUS" in
  13. ""|1)
  14. echo "General error mounting filesystems."
  15. echo "A maintenance shell will now be started."
  16. echo "CONTROL-D will terminate this shell and reboot the system."
  17. ;;
  18. 2)
  19. echo "Filesystem check or mount failed."
  20. echo "A maintenance shell will now be started."
  21. echo "CONTROL-D will terminate this shell and continue booting after re-trying"
  22. echo "filesystems. Any further errors will be ignored"
  23. ;;
  24. 3)
  25. echo "Root filesystem check failed."
  26. echo "A maintenance shell will now be started."
  27. echo "CONTROL-D will terminate this shell and reboot the system."
  28. ;;
  29. esac
  30. /sbin/sulogin
  31. end script
  32. post-stop script
  33. if [ -z "$UPSTART_STOP_EVENTS" ]
  34. then
  35. if [ "$EXIT_STATUS" = "2" ]
  36. then
  37. exec start --no-wait mountall
  38. else
  39. umount -a || :
  40. exec reboot -f
  41. fi
  42. fi
  43. end script