]> git.pld-linux.org Git - packages/ConsoleKit.git/blob - ConsoleKit.init
- /lib64 instead of /lib on x86_64
[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         exit $?
58         ;;
59   reload)
60         reload
61         ;;
62   force-reload)
63         # if program allows reloading without stopping
64         reload
65
66         # or if it doesn't
67         stop
68         start
69         ;;
70   status)
71         status $processname
72         RETVAL=$?
73         ;;
74   *)
75         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
76         exit 3
77 esac
78
79 exit $RETVAL
This page took 0.05599 seconds and 3 git commands to generate.