]> git.pld-linux.org Git - packages/csync2.git/blob - csync2.init
- inetd and standalone subpackages.
[packages/csync2.git] / csync2.init
1 #!/bin/sh
2 #
3 # csync2        This shell script takes care of starting and stopping csync2
4 #
5 # chkconfig:    345 90 25
6 # description:  csync2 daemon
7 # processname:  csync2
8 #
9 # pidfile:      /var/run/csync2.pid
10
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13
14 # Source networking configuration.
15 . /etc/sysconfig/network
16
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20                 msg_network_down csync2
21                 exit 1
22         fi
23 else
24         exit 0
25 fi
26
27 # Get service configuration
28 [ -f /etc/sysconfig/csync2 ] && . /etc/sysconfig/csync2
29
30 RETVAL=0
31 # See how we were called.
32 case "$1" in
33   start)
34         # Start daemons.
35         if [ ! -f /var/lock/subsys/csync2 ]; then
36                 msg_starting csync2
37                 daemon --fork csync2 -ii ${CSYNC2_OPTIONS}
38                 RETVAL=$?
39                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/csync2
40         else
41                 msg_already_running csync2
42         fi
43         ;;
44   stop)
45         # Stop daemons.
46         if [ -f /var/lock/subsys/csync2 ]; then
47                 msg_stopping csync2
48                 killproc csync2
49                 rm -f /var/lock/subsys/csync2 >/dev/null 2>&1
50         else
51                 msg_not_running csync2
52         fi
53         ;;
54   restart|reload|force-restart|force-reload)
55         $0 stop
56         $0 start
57         exit $?
58         ;;
59   status)
60         status csync2 csync2
61         exit $?
62         ;;
63   *)
64         msg_usage "$0 {start|stop|restart|reload|force-restart|force-reload|status}"
65         exit 3
66 esac
67
68 exit $RETVAL
This page took 0.097467 seconds and 4 git commands to generate.