[Techtalk] init script for rsync

Carla Schroder carla at bratgrrl.com
Mon Jun 21 18:33:23 EST 2004


This is a simple startup script to run rsync in daemon mode. It should run on 
all Linuxes, please note the refreshing absence of Red Hat- and other 
distribution isms. Methinks using #!/bin/sh for 'portability', then 
referencing /etc/sysconfig is sending mixed messages. :)

#!/bin/bash
# simple init script to start
# rsync in daemon mode

case "$1" in
	start)
		echo "Starting the rsync server..."
		exec /usr/bin/rsync --daemon 
		;;

	stop)
		echo "Stopping the rsync server...."
		killall /usr/bin/rsync
		;;
            
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
		
	*)
		echo "Usage: $0 {start|stop|reload|restart|status}"
		exit 1
		;;
esac

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carla Schroder
this message brought to you
by Libranet 2.8 and Kmail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Techtalk mailing list