]> TLD Linux GIT Repositories - packages/lxdm.git/blob - lxdm.init
- updated to 0.5.3, PLD merge
[packages/lxdm.git] / lxdm.init
1 #!/bin/sh
2 #
3 # lxdm:         Starts the LXDE Display Manager
4 #
5 # chkconfig:    5 95 05
6 #
7 # description:  Starts and stops the LXDM Display Manager at startup and \
8 #               shutdown..
9 # probe:        true
10 # hide:         true
11 #
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 start() {
16         # Check if the service is already running?
17         if [ -f /var/lock/subsys/lxdm ]; then
18                 msg_already_running "LXDE Display Manager"
19                 return
20         fi
21
22         msg_starting "LXDE Display Manager"
23         start-stop-daemon --start -b --exec /usr/sbin/lxdm -- -d
24         ok
25         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lxdm
26 }
27
28 stop() {
29         if [ ! -f /var/lock/subsys/lxdm ]; then
30                 msg_not_running "LXDE Display Manager"
31                 return
32         fi
33
34         # Stop daemons.
35         msg_stopping "LXDE Display Manager"
36         killproc lxdm
37         rm -f /var/lock/subsys/lxdm
38 }
39
40 condrestart() {
41         if [ ! -f /var/lock/subsys/lxdm ]; then
42                 msg_not_running "LXDE Display Manager"
43                 RETVAL=$1
44                 return
45         fi
46
47         stop
48         start
49 }
50
51 RETVAL=0
52 # See how we were called.
53 case "$1" in
54   start)
55         start
56         ;;
57   stop)
58         stop
59         ;;
60   restart)
61         stop
62         start
63         ;;
64   try-restart)
65         condrestart 0
66         ;;
67   force-reload)
68         condrestart 7
69         ;;
70   status)
71         status lxdm lxdm-binary
72         RETVAL=$?
73         ;;
74   *)
75         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
76         exit 3
77 esac
78
79 exit $RETVAL