Debian Codegraph @

debian/src/initscripts/etc/init.d/rmnologin

raw
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: rmnologin
4 # Required-Start: $remote_fs
5 # Required-Stop:
6 # Default-Start: 2 3 4 5
7 # Default-Stop:
8 # Short-Description: Remove /run/nologin at boot
9 # Description: This script removes the /run/nologin file as the
10 # last step in the boot process, if DELAYLOGIN=yes.
11 # If DELAYLOGIN=no, /run/nologin was not created by
12 # bootmisc earlier in the boot process.
13 ### END INIT INFO
14
15 PATH=/sbin:/bin
16 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
17 . /lib/init/vars.sh
18
19 do_start() {
20 #
21 # If login delaying is enabled then remove the flag file
22 #
23 case "$DELAYLOGIN" in
24 Y* | y*)
25 rm -f /run/nologin
26 ;;
27 esac
28 }
29
30 do_status() {
31 if [ ! -f /run/nologin ]; then
32 return 0
33 else
34 return 4
35 fi
36 }
37
38 case "$1" in
39 start)
40 do_start
41 ;;
42 restart | reload | force-reload)
43 echo "Error: argument '$1' not supported" >&2
44 exit 3
45 ;;
46 stop)
47 # No-op
48 ;;
49 status)
50 do_status
51 exit $?
52 ;;
53 *)
54 echo "Usage: $0 start|stop" >&2
55 exit 3
56 ;;
57 esac
58
59 :