]> git.pld-linux.org Git - packages/ConsoleKit.git/blob - ConsoleKit.init
- updated to 0.2.3
[packages/ConsoleKit.git] / ConsoleKit.init
1 #!/bin/sh
2 #
3 # ConsoleKit: ConsoleKit daemon
4 #
5 # chkconfig: 345 96 4
6 # description: The ConsoleKit maintains a list of sessions
7 #
8 # processname: console-kit-daemon
9 # pidfile: /var/run/ConsoleKit/pid
10 #
11
12 # Sanity checks.
13 [ -x /usr/sbin/console-kit-daemon ] || exit 0
14
15 # Source function library.
16 . /etc/rc.d/init.d/functions
17
18 # so we can rearrange this easily
19 processname=console-kit-daemon
20 servicename=ConsoleKit
21
22 start() {
23         # Check if the service is already running?
24         if [ ! -f /var/lock/subsys/$servicename ]; then
25                 msg_starting $servicename
26                 daemon $processname
27                 RETVAL=$?
28                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
29         else
30                 msg_already_running $servicename
31         fi
32 }
33
34 stop() {
35         if [ -f /var/lock/subsys/$servicename ]; then
36                 # Stop daemons.
37                 msg_stopping $servicename
38                 killproc $processname
39                 rm -f /var/lock/subsys/$servicename
40         else
41                 msg_not_running $servicename
42         fi
43 }
44
45 RETVAL=0
46 # See how we were called.
47 case "$1" in
48   start)
49         start
50         ;;
51   stop)
52         stop
53         ;;
54   restart)
55         stop
56         start
57         ;;
58   status)
59         status $processname
60         RETVAL=$?
61         ;;
62   *)
63         msg_usage "$0 {start|stop|restart|status}"
64         exit 3
65 esac
66
67 exit $RETVAL
This page took 0.031897 seconds and 3 git commands to generate.