PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/init/rc-sysinit.conf

http://github.com/brinkman83/bashrc
Config | 60 lines | 50 code | 10 blank | 0 comment | 0 complexity | bd0415c6387debecfff37a371b07002a MD5 | raw file
 1# rc-sysinit - System V initialisation compatibility
 2#
 3# This task runs the old System V-style system initialisation scripts,
 4# and enters the default runlevel when finished.
 5
 6description	"System V initialisation compatibility"
 7author		"Scott James Remnant <scott@netsplit.com>"
 8
 9start on filesystem and net-device-up IFACE=lo
10stop on runlevel
11
12# Default runlevel, this may be overriden on the kernel command-line
13# or by faking an old /etc/inittab entry
14env DEFAULT_RUNLEVEL=2
15
16# There can be no previous runlevel here, but there might be old
17# information in /var/run/utmp that we pick up, and we don't want
18# that.
19#
20# These override that
21env RUNLEVEL=
22env PREVLEVEL=
23
24console output
25env INIT_VERBOSE
26
27task
28
29script
30    # Check for default runlevel in /etc/inittab
31    if [ -r /etc/inittab ]
32    then
33	eval "$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL="\1";/p' /etc/inittab || true)"
34    fi
35
36    # Check kernel command-line for typical arguments
37    for ARG in $(cat /proc/cmdline)
38    do
39	case "${ARG}" in
40	-b|emergency)
41	    # Emergency shell
42	    [ -n "${FROM_SINGLE_USER_MODE}" ] || sulogin
43	    ;;
44	[0123456sS])
45	    # Override runlevel
46	    DEFAULT_RUNLEVEL="${ARG}"
47	    ;;
48	-s|single)
49	    # Single user mode
50	    [ -n "${FROM_SINGLE_USER_MODE}" ] || DEFAULT_RUNLEVEL=S
51	    ;;
52	esac
53    done
54
55    # Run the system initialisation scripts
56    [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/rcS
57
58    # Switch into the default runlevel
59    telinit "${DEFAULT_RUNLEVEL}"
60end script