[46cef72] | 1 | <sect2>
|
---|
| 2 | <title>Configuring <application>rsync</application></title>
|
---|
| 3 |
|
---|
| 4 | <sect3><title>Config files</title>
|
---|
| 5 | <para><filename>/etc/rsyncd.conf</filename></para>
|
---|
[1f686d2] | 6 | </sect3>
|
---|
| 7 |
|
---|
| 8 | <sect3><title>Configuration Information</title>
|
---|
| 9 |
|
---|
[46cef72] | 10 | <para>This is a simple download-only configuration. See the rsyncd man-page for
|
---|
[a4be499] | 11 | additional options (i.e. user authentication).</para>
|
---|
[46cef72] | 12 |
|
---|
[cce6b02e] | 13 | <screen><userinput><command>cat > /etc/rsyncd.conf << "EOF"</command>
|
---|
[46cef72] | 14 | # This is a basic rsync configuration file
|
---|
[a4be499] | 15 | # It exports a single module without user authentication.
|
---|
[46cef72] | 16 |
|
---|
| 17 | motd file = /home/rsync/welcome.msg
|
---|
| 18 | use chroot = yes
|
---|
| 19 |
|
---|
| 20 | [localhost]
|
---|
[1f686d2] | 21 | path = /home/rsync
|
---|
| 22 | comment = Default rsync module
|
---|
| 23 | read only = yes
|
---|
| 24 | list = yes
|
---|
| 25 | uid = rsyncd
|
---|
| 26 | gid = rsyncd
|
---|
[46cef72] | 27 |
|
---|
[cce6b02e] | 28 | <command>EOF</command></userinput></screen>
|
---|
[46cef72] | 29 | </sect3>
|
---|
| 30 |
|
---|
| 31 | <sect3><title>rsyncd init.d script</title>
|
---|
| 32 |
|
---|
[cce6b02e] | 33 | <para>Note that you only want to start the <application>rsync</application>
|
---|
| 34 | server if you want to provide a <application>rsync</application> archive on
|
---|
| 35 | your machine. The <application>rsync</application> client doesn't need this
|
---|
| 36 | script to be used. Having said that, if you want to run the <application>rsync
|
---|
[ca89a835] | 37 | </application> daemon, the <application>rsync</application> daemon init.d script can be
|
---|
[cce6b02e] | 38 | created using the following commands:</para>
|
---|
[46cef72] | 39 |
|
---|
[cce6b02e] | 40 | <screen><userinput><command>cat > /etc/rc.d/init.d/rsyncd << "EOF"</command>
|
---|
[46cef72] | 41 | #!/bin/sh
|
---|
| 42 | # Begin $rc_base/init.d/rsyncd
|
---|
| 43 |
|
---|
| 44 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 45 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 46 |
|
---|
[369af35a] | 47 | . /etc/sysconfig/rc
|
---|
| 48 | . $rc_functions
|
---|
[46cef72] | 49 |
|
---|
| 50 | case "$1" in
|
---|
[1f686d2] | 51 | start)
|
---|
| 52 | echo "Starting RSYNC Server..."
|
---|
| 53 | loadproc /usr/bin/rsync --daemon --compress
|
---|
| 54 | ;;
|
---|
| 55 |
|
---|
| 56 | stop)
|
---|
| 57 | echo "Stopping RSYNC Server..."
|
---|
| 58 | killproc /usr/bin/rsync
|
---|
| 59 | ;;
|
---|
| 60 |
|
---|
| 61 | reload)
|
---|
| 62 | echo "Reloading RSYNC Server..."
|
---|
| 63 | reloadproc /usr/bin/rsync
|
---|
| 64 | ;;
|
---|
[46cef72] | 65 |
|
---|
[1f686d2] | 66 | restart)
|
---|
| 67 | $0 stop
|
---|
| 68 | sleep 1
|
---|
| 69 | $0 start
|
---|
| 70 | ;;
|
---|
| 71 |
|
---|
| 72 | status)
|
---|
| 73 | statusproc /usr/bin/rsync
|
---|
| 74 | ;;
|
---|
| 75 |
|
---|
| 76 | *)
|
---|
| 77 | echo "Usage: $0 {start|stop|reload|restart|status}"
|
---|
| 78 | exit 1
|
---|
| 79 | ;;
|
---|
[46cef72] | 80 | esac
|
---|
| 81 |
|
---|
| 82 | # End $rc_base/init.d/rsyncd
|
---|
| 83 | <command>EOF
|
---|
[cce6b02e] | 84 | chmod 755 /etc/rc.d/init.d/rsyncd</command></userinput></screen>
|
---|
[46cef72] | 85 |
|
---|
| 86 | <para>Create the symbolic links to this file in the relevant
|
---|
| 87 | <filename class="directory">rc.d</filename> directories with the following
|
---|
[cce6b02e] | 88 | commands:</para>
|
---|
[46cef72] | 89 | <screen><userinput><command>cd /etc/rc.d/init.d &&
|
---|
| 90 | ln -sf ../init.d/rsyncd ../rc0.d/K30rsyncd &&
|
---|
| 91 | ln -sf ../init.d/rsyncd ../rc1.d/K30rsyncd &&
|
---|
| 92 | ln -sf ../init.d/rsyncd ../rc2.d/K30rsyncd &&
|
---|
| 93 | ln -sf ../init.d/rsyncd ../rc3.d/S30rsyncd &&
|
---|
| 94 | ln -sf ../init.d/rsyncd ../rc4.d/S30rsyncd &&
|
---|
| 95 | ln -sf ../init.d/rsyncd ../rc5.d/S30rsyncd &&
|
---|
[cce6b02e] | 96 | ln -sf ../init.d/rsyncd ../rc6.d/K30rsyncd</command></userinput></screen>
|
---|
[46cef72] | 97 |
|
---|
| 98 | </sect3>
|
---|
| 99 |
|
---|
| 100 | </sect2>
|
---|