File lsyncd-init.d of Package lsyncd

#!/bin/bash
#
### BEGIN INIT INFO
# Provides:lsyncd
# Required-Start:       $local_fs $remote_fs $network
# Required-Stop:        $local_fs $remote_fs $network
# Default-Start:3 5
# Default-Stop:0 1 2 6
# Short-Description:Start lsyncd
# Description:Lsyncd uses rsync to synchronize local directories with a remote machine running rsyncd.
### END INIT INFO

config="/etc/lsyncd/lsyncd.conf"
lsyncd="/usr/bin/lsyncd"
prog="lsyncd"

. /etc/rc.status

rc_reset

case "$1" in
start)
echo -n "Starting $prog: "
$lsyncd  -log Exec $config
rc_status -v
;;
stop)
echo -n "Shutting down $prog: "
/bin/kill -9 `/sbin/pidof lsyncd`
until [ -z $(/sbin/pidof lsyncd) ]; do :; done                                                                                                                                      
rc_status -v                                                                                                                                                                        
;;                                                                                                                                                                                  
restart)                                                                                                                                                                            
$0 stop                                                                                                                                                                             
$0 start                                                                                                                                                                            
rc_status                                                                                                                                                                           
;;                                                                                                                                                                                  
status)                                                                                                                                                                             
echo -n "$prog status:"                                                                                                                                                             
rc_status -v                                                                                                                                                                        
;;                                                                                                                                                                                  
*)                                                                                                                                                                                  
echo "Usage: $0 {start|stop|restart|status}"                                                                                                                                        
exit 1                                                                                                                                                                              
;;                                                                                                                                                                                  
esac                                                                                                                                                                                
                                                                                                                                                                                    
rc_exit  
openSUSE Build Service is sponsored by