blob: 7747623b4316b628bd3cd79b46d871cd54a3544d (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/lightdm: start/stop lightdm
4 #
5
6 SSD=/sbin/start-stop-daemon
7 PROG=/usr/bin/lightdm
8 OPTS="--pid-file=/var/run/lightdm/lightdm.pid"
9 RUNDIR=/var/run/lightdm
10 PIDFILE=$RUNDIR/lightdm.pid
11
12 case $1 in
13 start)
14 $SSD --start --pidfile=$PIDFILE --exec $PROG -- $OPTS
15 ;;
16 stop)
17 $SSD --stop --retry 10 --pidfile=$PIDFILE
18 ;;
19 restart)
20 $0 stop
21 $0 start
22 ;;
23 status)
24 $SSD --status --exec $PROG
25 case $? in
26 0) echo "$PROG is running with pid $(pidof $PROG)" ;;
27 1) echo "$PROG is not running but the pid file $PID exists" ;;
28 3) echo "$PROG is not running" ;;
29 4) echo "Unable to determine the program status" ;;
30 esac
31 ;;
32 *)
33 echo "usage: $0 [start|stop|restart|status]"
34 ;;
35 esac
|