#!/bin/bash # # lsyncd # # chkconfig: 345 56 50 # description: xinetd is a powerful replacement for inetd. \ # xinetd has access control mechanisms, extensive \ # logging capabilities, the ability to make services \ # available based on time, and can place \ # limits on the number of servers that can be started, \ # among other things. # # processname: /opt/lsyncd/binlsyncd #Source function library . /etc/rc.d/init.d/functions PATH=$PATH:/sbin:/bin:/usr/bin:/usr/sbin:/opt/lsyncd/bin:/usr/local/bin # Soruce networking configuration [ -r /etc/sysconfig/lsync ] && . /etc/sysconfig/lsyncd #option="$SHORT_LOG $IGNORE_START_ERRORS $DEBUG" RETVAL=0 prog="lsyncd" start(){ echo -n $"Starting $prog: " #daemon $prog $option daemon $prog RETVAL=$? echo touch /var/lock/subsys/lsyncd return $RETVAL } stop(){ echo -n $"Stopping $prog: " killproc $prog RETVAL=$? echo rm -f /var/lock/subsys/lsyncd return $RETVAL } reload(){ echo -n $"Reloading configuration: " killproc $prog -HUP RETVAL=$? echo return $RETVAL } restart(){ stop start } condrestart(){ [ -e /var/lock/subsys/lsyncd ] && restart return 0 } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $prog ;; restart) restart ;; reload) reload ;; condrestart) condrestart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" RETVAL=1 esac exit $RETVA