Blame view

rpm/clsync.init 1.06 KB
Enrique Martinez authored
1 2
#! /bin/sh
#
Enrique Martinez authored
3 4
# author: Enrique Martinez <enmaca@hotmail.com>
# license: GPL-3+
Enrique Martinez authored
5
#
Enrique Martinez authored
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# clsync
# chkconfig:    2345 98 02
# pidfile:     /var/run/clsync/clsync.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

CLSYNCCMD=/usr/bin/clsync

# Source monit configuration.
if [ -f /etc/sysconfig/clsync ] ; then
. /etc/sysconfig/clsync
fi

[ -f $CLSYNCCMD ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
start)
Enrique Martinez authored
30 31 32 33 34 35
	echo -n "Starting clsync: "
	daemon $CLSYNCCMD --pid-file /var/run/clsync/clsync.pid
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && touch /var/lock/subsys/nosearch_cached
	;;
Enrique Martinez authored
36
stop)
Enrique Martinez authored
37 38 39 40 41 42
	echo -n "Stopping clsync: "
	killproc -p /var/run/clsync/clsync.pid
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/clsync
	;;
Enrique Martinez authored
43
restart)
Enrique Martinez authored
44 45 46 47 48 49 50 51 52 53 54 55 56
	$0 stop
	$0 start
	;;
reload)
	echo -n "Reloading clsync: "
	killproc -p /var/run/clsync/clsync.pid clsync -HUP
	RETVAL=$?
	echo
	;;
status)
	status -p /var/run/clsync/clsync.pid clsync
	RETVAL=$?
	;;
Enrique Martinez authored
57
*)
Enrique Martinez authored
58
echo "Usage: $0 (start|stop|reload|status)"
Enrique Martinez authored
59 60 61 62
exit 1
esac

exit $RETVAL