PageRenderTime 71ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 1ms

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