wok view slim/stuff/etc/init.d/slim @ rev 19703
Up newt-dev (0.52.19)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 14 14:54:28 2017 +0100 (2017-02-14) |
parents | 7f188676b59c |
children |
line source
1 #!/bin/sh
2 # /etc/init.d/slim: Start, stop and restart Slim daemon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/slim.conf.
7 #
8 . /etc/init.d/rc.functions
10 NAME=SLiM
11 DESC="$(_ 'Simple login manager')"
12 DAEMON=/usr/bin/slim
13 OPTION="-d"
14 LOCK_FILE=/var/lock/slim.lock
16 case "$1" in
17 start)
18 if active_pidfile $LOCK_FILE slim ; then
19 _ '%s is already running.' $NAME
20 exit 1
21 fi
22 action 'Starting %s: %s...' "$DESC" $NAME
23 $DAEMON $OPTION
24 status
25 ;;
26 stop)
27 if ! active_pidfile $LOCK_FILE slim ; then
28 _ '%s is not running.' $NAME
29 exit 1
30 fi
31 action 'Stopping %s: %s...' "$DESC" $NAME
32 killall slim
33 rm $LOCK_FILE
34 status
35 ;;
36 restart)
37 if ! active_pidfile $LOCK_FILE slim ; then
38 _ '%s is not running.' $NAME
39 exit 1
40 fi
41 action 'Restarting %s: %s...' "$DESC" $NAME
42 killall slim
43 rm $LOCK_FILE
44 sleep 2
45 $DAEMON $OPTION
46 status
47 ;;
48 *)
49 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
50 newline
51 exit 1
52 ;;
53 esac
55 exit 0