< Day Day Up > |
Recipe 16.7. Launching the rsync Daemon at Startup16.7.1 ProblemYou don't want to start the rsync daemon by hand all the time. But rsync does not come with an init script. How do you make it start at boot time? 16.7.2 SolutionPut this script in /etc/init.d, then add it to your desired runlevels: #!/bin/bash # simple init script to run # 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|restart}" exit 1 ;; esac 16.7.3 DiscussionRemember to chmod +x to make this script executable. 16.7.4 See Also
|
< Day Day Up > |