Linux Cookbook
| < Day Day Up > |
16.7.1 Problem
You 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 Solution
Put 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 Discussion
Remember to chmod +x to make this script executable. 16.7.4 See Also
|
| < Day Day Up > |