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
|
---|
8 | additional options (i.e. user authentication).</para>
|
---|
9 |
|
---|
10 | <screen><userinput><command>cat > /etc/rsyncd.conf << "EOF"</command>
|
---|
11 | # This is a basic rsync configuration file
|
---|
12 | # It exports a single module without user authentication.
|
---|
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 |
|
---|
25 | <command>EOF</command></userinput></screen>
|
---|
26 | </sect3>
|
---|
27 |
|
---|
28 | <sect3><title>rsyncd init.d script</title>
|
---|
29 |
|
---|
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
|
---|
34 | </application> daemon, the <application>rsync</application> daemon init.d script can be
|
---|
35 | created using the following commands:</para>
|
---|
36 |
|
---|
37 | <screen><userinput><command>cat > /etc/rc.d/init.d/rsyncd << "EOF"</command>
|
---|
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
|
---|
81 | chmod 755 /etc/rc.d/init.d/rsyncd</command></userinput></screen>
|
---|
82 |
|
---|
83 | <para>Create the symbolic links to this file in the relevant
|
---|
84 | <filename class="directory">rc.d</filename> directories with the following
|
---|
85 | commands:</para>
|
---|
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 &&
|
---|
93 | ln -sf ../init.d/rsyncd ../rc6.d/K30rsyncd</command></userinput></screen>
|
---|
94 |
|
---|
95 | </sect3>
|
---|
96 |
|
---|
97 | </sect2>
|
---|
98 |
|
---|