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