Debian Codegraph @

debian/src/bootlogd/etc/init.d/stop-bootlogd-single

raw
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: stop-bootlogd-single
4 # Required-Start: $local_fs
5 # Required-Stop:
6 # Default-Start: S
7 # Default-Stop:
8 # Short-Description: Stop bootlogd in single user mode
9 # Description: See the init.d/bootlogd script
10 ### END INIT INFO
11 #
12 # This has to run in the boot sequence (rcS.d), and not in the "single
13 # user" sequence (rc1.d), because rc1.d/ is not used when booting into
14 # single user. "grep :[S1]: /etc/inittab" show that single user is just
15 # a call to /sbin/sulogin, while runlevel 1 is a call to
16 # "/etc/init.d/rc 1" which in the end switches to runlevel S to run
17 # /sbin/sulogin.
18
19 PATH=/sbin:/usr/sbin:/bin:/usr/bin
20 NAME=stop-bootlogd-single
21 DAEMON=/sbin/bootlogd
22
23 [ -x "$DAEMON" ] || exit 0
24 [ -d /run/systemd/system ] && exit 0
25
26 case "$1" in
27 start)
28 single=false
29 for word in $(cat /proc/cmdline); do
30 case "$word" in
31 S | single | 1)
32 single=true
33 ;;
34 esac
35 done
36 if [ true = "$single" ]; then
37 /etc/init.d/bootlogd stop
38 fi
39 ;;
40 stop | restart | force-reload)
41 # No-op
42 ;;
43 status)
44 exec /etc/init.d/bootlogd status
45 ;;
46 *)
47 echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
48 exit 3
49 ;;
50 esac
51
52 :