wok view slim/stuff/etc/init.d/slim @ rev 2005

Up: xpad (3.0)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Jan 08 20:25:24 2009 +0100 (2009-01-08)
parents
children 23c93873adcf
line source
1 #!/bin/sh
2 # /etc/init.d/slim: Start, stop and restart Slim deamon 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="slim 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 [ -f $LOCK_FILE ] ; then
19 echo "$NAME already running."
20 exit 1
21 fi
22 echo -n "Starting $DESC: $NAME... "
23 $DAEMON $OPTION
24 status
25 ;;
26 stop)
27 if [ ! -f $LOCK_FILE ] ; then
28 echo "$NAME is not running."
29 exit 1
30 fi
31 echo -n "Stopping $DESC: $NAME... "
32 killall slim
33 rm $LOCK_FILE
34 status
35 ;;
36 restart)
37 if [ ! -f $PIDFILE ] ; then
38 echo "$NAME is not running."
39 exit 1
40 fi
41 echo -n "Restarting $DESC: $NAME... "
42 killall slim
43 rm $LOCK_FILE
44 sleep 2
45 $DAEMON $OPTION
46 status
47 ;;
48 *)
49 echo ""
50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
51 echo ""
52 exit 1
53 ;;
54 esac
56 exit 0