forked from iwamatsu/slim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslim.sysv
executable file
·70 lines (59 loc) · 1.7 KB
/
slim.sysv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
### BEGIN INIT INFO
# Provides: slim
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start: xfs $named
# Should-Stop: xfs $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Slim Lightweight Graphical Login Manager
# Description: SLiM Display Manager system level init script.
### END INIT INFO
# if not something else set to true.
test -z "$HEED_DEFAULT_DISPLAY_MANAGER" && HEED_DEFAULT_DISPLAY_MANAGER=true
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
NAME="slim"
DESC="X display and login manager"
DAEMON=/usr/local/bin/slim
PIDFILE=/var/run/slim.lock
SSD_START_ARGS="--pidfile $PIDFILE --name $NAME --startas $DAEMON -- -d"
SSD_STOP_ARGS="--pidfile $PIDFILE --name $NAME --retry TERM/5/TERM/5"
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case $1 in
start)
if [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
log_daemon_msg "Not starting $DESC ($NAME); it is not the default display manager." "$NAME"
else
log_daemon_msg "Starting $NAME" "$NAME"
start-stop-daemon --start --quiet $SSD_START_ARGS
log_end_msg $?
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet $SSD_STOP_ARGS
log_end_msg $?
rm -f $PIDFILE
;;
restart)
$0 stop
sleep 2
$0 start
;;
force-reload)
/etc/init.d/slim restart
;;
status)
status_of_proc $DAEMON $NAME
pgrep $NAME
;;
*)
echo "Usage: /etc/init.d/slim {start|stop|restart|force-reload|status}"
exit 1
;;
esac
# End of file