2003-08-31 22:39:34 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Configuring <application>rsync</application></title>
|
|
|
|
|
|
|
|
<sect3><title>Config files</title>
|
|
|
|
|
|
|
|
<para><filename>/etc/rsyncd.conf</filename></para>
|
|
|
|
<para>This is a simple download-only configuration. See the rsyncd man-page for
|
|
|
|
additional options (i.e. user authentification).</para>
|
|
|
|
|
2003-09-24 09:52:37 +08:00
|
|
|
<screen><userinput><command>cat > /etc/rsyncd.conf << "EOF"</command>
|
2003-08-31 22:39:34 +08:00
|
|
|
# This is a basic rsync configuration file
|
|
|
|
# It exports a single module without user authentification.
|
|
|
|
|
|
|
|
motd file = /home/rsync/welcome.msg
|
|
|
|
use chroot = yes
|
|
|
|
|
|
|
|
[localhost]
|
|
|
|
path = /home/rsync
|
|
|
|
comment = Default rsync module
|
|
|
|
read only = yes
|
|
|
|
list = yes
|
|
|
|
uid = rsyncd
|
|
|
|
gid = rsyncd
|
|
|
|
|
2003-09-24 09:52:37 +08:00
|
|
|
<command>EOF</command></userinput></screen>
|
2003-08-31 22:39:34 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3><title>rsyncd init.d script</title>
|
|
|
|
|
2003-09-24 09:52:37 +08:00
|
|
|
<para>Note that you only want to start the <application>rsync</application>
|
|
|
|
server if you want to provide a <application>rsync</application> archive on
|
|
|
|
your machine. The <application>rsync</application> client doesn't need this
|
|
|
|
script to be used. Having said that, if you want to run the <application>rsync
|
|
|
|
</application> daemon, the <command>rsyncd</command> init.d script can be
|
|
|
|
created using the following commands:</para>
|
2003-08-31 22:39:34 +08:00
|
|
|
|
2003-09-24 09:52:37 +08:00
|
|
|
<screen><userinput><command>cat > /etc/rc.d/init.d/rsyncd << "EOF"</command>
|
2003-08-31 22:39:34 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# Begin $rc_base/init.d/rsyncd
|
|
|
|
|
|
|
|
# Based on sysklogd script from LFS-3.1 and earlier.
|
|
|
|
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
|
|
|
|
|
|
|
source /etc/sysconfig/rc
|
|
|
|
source $rc_functions
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo "Starting RSYNC Server..."
|
|
|
|
loadproc /usr/bin/rsync --daemon --compress
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
echo "Stopping RSYNC Server..."
|
|
|
|
killproc /usr/bin/rsync
|
|
|
|
;;
|
|
|
|
|
|
|
|
reload)
|
|
|
|
echo "Reloading RSYNC Server..."
|
|
|
|
reloadproc /usr/bin/rsync
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 1
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
|
|
|
|
status)
|
|
|
|
statusproc /usr/bin/rsync
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|reload|restart|status}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End $rc_base/init.d/rsyncd
|
|
|
|
<command>EOF
|
2003-09-24 09:52:37 +08:00
|
|
|
chmod 755 /etc/rc.d/init.d/rsyncd</command></userinput></screen>
|
2003-08-31 22:39:34 +08:00
|
|
|
|
|
|
|
<para>Create the symbolic links to this file in the relevant
|
|
|
|
<filename class="directory">rc.d</filename> directories with the following
|
2003-09-24 09:52:37 +08:00
|
|
|
commands:</para>
|
2003-08-31 22:39:34 +08:00
|
|
|
<screen><userinput><command>cd /etc/rc.d/init.d &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc0.d/K30rsyncd &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc1.d/K30rsyncd &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc2.d/K30rsyncd &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc3.d/S30rsyncd &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc4.d/S30rsyncd &&
|
|
|
|
ln -sf ../init.d/rsyncd ../rc5.d/S30rsyncd &&
|
2003-09-24 09:52:37 +08:00
|
|
|
ln -sf ../init.d/rsyncd ../rc6.d/K30rsyncd</command></userinput></screen>
|
2003-08-31 22:39:34 +08:00
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|