davideuler / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

rm: cannot remove `/data/test//aaaa/txt.txt': Permission denied #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I am testing lsyncd
I have two identical servers with identical directory structure.
Syncing these two servers are working fine for creating directories and/or 
files.
The problem is when deleting directories/files I always get permission denied.
But when I restart lsyncd these directories/files are delted without problem.

What is the expected output? What do you see instead?
Directories/Files should be deleted on the remote server without restarting 
lsyncd

What version of the product are you using? On what operating system?
Debian squeeze, lsyncd version 2.0.4

Please provide any additional information below.
My config file looks like

settings = {
   logfile    = "/var/log/lsyncd/lsyncd.log",
   statusFile = "/var/log/lsyncd/lsyncd.status",
}

sync{default.rsyncssh, source="/data/test", host="rsyncuser@10.0.0.1", 
targetdir="/data/test", rsyncOps={"-vaxA", "--rsync-path=sudo rsync"}}

Original issue reported on code.google.com by wfor...@gmail.com on 12 Jul 2011 at 8:03

GoogleCodeExporter commented 9 years ago
Can you please turn on -log all, and make a short snipped of the log when you 
delete a file or two (and wait a mintue)?

Plain workarond for right now, use plain default.rsync without ssh (the 
downside of this is mainly that moving files will result in the file being 
transmited over the wire instead of simply moving it on the target instead.)

Original comment by axk...@gmail.com on 12 Jul 2011 at 8:43

GoogleCodeExporter commented 9 years ago
Oh I think I see it already. I suppose the reason is, you change permissions 
with your sudo command to rsync. But with rsyncssh Lsyncd will also create 
simple ssh connections to the target to move or remove files, there the sudo is 
missing.

Right now there isn't a "sshOps" and something that will likely being added in 
the next Lsyncd version.

So either: You use default.rsync or you have to use a user right away that has 
enough permissions without sudo. 

Original comment by axk...@gmail.com on 12 Jul 2011 at 8:54

GoogleCodeExporter commented 9 years ago
many thanks, I tried it with the root user and now it is working.
But it would be a great feature (from security perspective) to use sudo with a 
non root user.

Original comment by wfor...@gmail.com on 12 Jul 2011 at 9:13

GoogleCodeExporter commented 9 years ago
Wouldn't you make the all dirs and files in the target directory be owned by 
rsyncuser? 

What happens if some Lsyncd bug emmits rm -rf / ... I took extra double 
precautions to hinder that, but I don't want to be made responsible :-)

Original comment by axk...@gmail.com on 12 Jul 2011 at 9:32

GoogleCodeExporter commented 9 years ago
no, in my case its not possible, because i would like to have an exact copy, 
with all permissions (owner, group, ...)
the second server is a fail over
before I use rsync+ssh to sync these two server once a day, but I would like to 
have some live sync

Original comment by wfor...@gmail.com on 13 Jul 2011 at 5:19

GoogleCodeExporter commented 9 years ago
Can be closed

Original comment by wimdegee...@gmail.com on 15 Jul 2011 at 2:32

GoogleCodeExporter commented 9 years ago

Original comment by axk...@gmail.com on 29 Jul 2011 at 10:13