glfs/server/other/rsync/rsync-config.xml

99 lines
2.6 KiB
XML
Raw Normal View History

<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>
<screen><userinput><command>cat &gt; /etc/rsyncd.conf &lt;&lt; "EOF"</command>
# 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
<command>EOF</command></userinput></screen>
</sect3>
<sect3><title>rsyncd init.d script</title>
<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>
<screen><userinput><command>cat &gt; /etc/rc.d/init.d/rsyncd &lt;&lt; "EOF"</command>
#!/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
chmod 755 /etc/rc.d/init.d/rsyncd</command></userinput></screen>
<para>Create the symbolic links to this file in the relevant
<filename class="directory">rc.d</filename> directories with the following
commands:</para>
<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
ln -sf ../init.d/rsyncd ../rc0.d/K30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc1.d/K30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc2.d/K30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc3.d/S30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc4.d/S30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc5.d/S30rsyncd &amp;&amp;
ln -sf ../init.d/rsyncd ../rc6.d/K30rsyncd</command></userinput></screen>
</sect3>
</sect2>