frank.gruellich at here.com
2013-Aug-05 14:44 UTC
rsyncd: --temp-dir outside of module or target target
Hi, I'm running rsyncd in daemon mode started via xinetd. My /etc/rsyncd.conf looks like: [cache] path = /mnt/tst_vol_aws/sat_p_cache/ comment = Cache Directory use chroot = false read only = false uid = someone gid = someone dont compress = * On the client I run: /usr/bin/rsync --delete --ignore-errors -gpzsoltD --temp-dir=/mnt/tst_vol_aws/tmp/rsync -r /mnt/tst_vol_aws/sat_p_cache/ rsync://$server_ip/cache/ which gives me the following errors: Aug 5 10:33:24 ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158425.n2v31h" (in cache) failed: No such file or directory (2) Aug 5 10:33:24 ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158426.8v42GW" (in cache) failed: No such file or directory (2) Aug 5 10:33:24 ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158427.5LDOmB" (in cache) failed: No such file or directory (2) It seems it tries to create --temp-dir inside the module or target path. That's not desired in my case as rsync is started via lsyncd which watches /mnt/tst_vol_aws/sat_p_cache/ for changes, so rsync doing temporary changes there would cause lsynd to spin in circles. The lsyncd documentation recommends to have --temp-dir outside, eg. in /tmp/. However, I fail to get that configured. I tried setting the module path to /mnt/tst_vol_aws/, do rsync to rsync://$server_ip/cache/sat_p_cache/ with a --temp-dir=tmp/rsync/, however, that resulted in a pretty similar error message (clueing that it's actually the target path defining the root for --temp-dir. The --inplace option is also not a way to go. Any idea how to do this? Thanks a lot. Kind regards, Frank.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The solution would be to use rsync over ssh instead of rsyncd. With rsyncd you can only access stuff inside the defined module. On 08/05/13 10:44, frank.gruellich at here.com wrote:> Hi, > > I'm running rsyncd in daemon mode started via xinetd. My > /etc/rsyncd.conf looks like: > > [cache] path = /mnt/tst_vol_aws/sat_p_cache/ comment = Cache > Directory use chroot = false read only = false uid = someone gid > someone dont compress = * > > On the client I run: > > /usr/bin/rsync --delete --ignore-errors -gpzsoltD > --temp-dir=/mnt/tst_vol_aws/tmp/rsync -r > /mnt/tst_vol_aws/sat_p_cache/ rsync://$server_ip/cache/ > > which gives me the following errors: > > Aug 5 10:33:24 ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp > "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158425.n2v31h" > (in cache) failed: No such file or directory (2) Aug 5 10:33:24 > ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp > "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158426.8v42GW" > (in cache) failed: No such file or directory (2) Aug 5 10:33:24 > ip-10-209-129-163 rsyncd[3028]: rsync: mkstemp > "/mnt/tst_vol_aws/sat_p_cache/mnt/tst_vol_aws/tmp/rsync//.80940_158427.5LDOmB" > (in cache) failed: No such file or directory (2) > > It seems it tries to create --temp-dir inside the module or target > path. That's not desired in my case as rsync is started via lsyncd > which watches /mnt/tst_vol_aws/sat_p_cache/ for changes, so rsync > doing temporary changes there would cause lsynd to spin in circles. > The lsyncd documentation recommends to have --temp-dir outside, eg. > in /tmp/. However, I fail to get that configured. I tried setting > the module path to /mnt/tst_vol_aws/, do rsync to > rsync://$server_ip/cache/sat_p_cache/ with a > --temp-dir=tmp/rsync/, however, that resulted in a pretty similar > error message (clueing that it's actually the target path defining > the root for --temp-dir. The --inplace option is also not a way to > go. > > Any idea how to do this? Thanks a lot. > > Kind regards, Frank. >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlIAKykACgkQVKC1jlbQAQc23QCePBjjHXc9xufNtgxAtIPhZeks ySgAniIBM3v2EcqhEa1uOH22DWny9ux/ =yJa+ -----END PGP SIGNATURE-----
On Mon, Aug 5, 2013 at 7:44 AM, <frank.gruellich at here.com> wrote:> [cache] > path = /mnt/tst_vol_aws/sat_p_cache/use chroot = false>[...]> On the client I run: > /usr/bin/rsync --delete --ignore-errors -gpzsoltD > --temp-dir=/mnt/tst_vol_aws/tmp/rsync -r /mnt/tst_vol_aws/sat_p_cache/ > rsync://$server_ip/cacheRsync protects all paths from the user so that they cannot specify something outside the module (which would be unsafe unless you fully trust the users, which rsync assumes you do not since you are using daemon protocol instead of a remote shell). That said, you can specify some options to make things less safe and thus accomplish what you want. One solution: - On the server side, create a symlink inside the module's hierarchy that points to the temp area you want to use (or part of its parent path). e.g.: ln -s ../tmp/rsync /mnt/tst_vol_aws/sat_p_cache/tmp-rsync - Either specify "use chroot = false" in the module config (which you do) or leave chrooting enabled and allow one directory higher outside the module area to be included inside the chroot via a /./ dir (this would work because I created a relative symlink above). e.g.: path = /mnt/tst_vol_aws/./sat_p_cache use chroot = true - You would then specify the symlink's path inside the module for your temp-dir option. e.g.: --temp-dir=/tmp-rsync ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20130808/a26f8c70/attachment.html>