]> git.pld-linux.org Git - packages/cvsnt.git/blob - cvsnt-cvslockd.init
- unify, cleanups
[packages/cvsnt.git] / cvsnt-cvslockd.init
1 #!/bin/sh
2 #
3 # cvslockd              This shell script takes care of starting and stopping cvslockd.
4 #
5 # chkconfig:    2345 80 30
6 # description:  cvslockd is a cvs locking server
7 #
8 # processname:  cvslockd
9 # config:
10 # pidfile:
11
12 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Source oident configureation.
16 if [ -f /etc/sysconfig/cvslockd ]; then
17         . /etc/sysconfig/cvslockd
18 fi
19
20 start() {
21         # Start daemons.
22         if [ -f /var/lock/subsys/cvslockd ]; then
23                 msg_already_running "cvslockd"
24                 return
25         fi
26
27         msg_starting "cvslockd"
28         daemon /usr/bin/cvslockd
29         RETVAL=$?
30         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cvslockd
31 }
32
33 stop() {
34         # Stop daemons.
35         if [ ! -f /var/lock/subsys/cvslockd ]; then
36                 msg_not_running "cvslockd"
37                 return
38         fi
39
40         msg_stopping "cvslockd"
41         killproc cvslockd
42         rm -f /var/lock/subsys/cvslockd >/dev/null 2>&1
43 }
44
45 condrestart() {
46         if [ ! -f /var/lock/subsys/cvslockd ]; then
47                 msg_not_running "cvslockd"
48                 RETVAL=$1
49                 return
50         fi
51
52         stop
53         start
54 }
55
56 RETVAL=0
57 # See how we were called.
58 case "$1" in
59   start)
60         start
61         ;;
62   stop)
63         stop
64         ;;
65   restart)
66         stop
67         start
68         ;;
69   try-restart)
70         condrestart 0
71         ;;
72   force-reload)
73         condrestart 7
74         ;;
75   status)
76         status cvslockd
77         exit $?
78         ;;
79   *)
80         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
81         exit 3
82 esac
83
84 exit $RETVAL
This page took 0.03101 seconds and 3 git commands to generate.