Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relative path ^pathname starts with a slash !? #364

Closed
jtognazzi opened this issue Feb 9, 2016 · 10 comments
Closed

relative path ^pathname starts with a slash !? #364

jtognazzi opened this issue Feb 9, 2016 · 10 comments

Comments

@jtognazzi
Copy link

With the rpm version 2.1.5 from epel6, I have the following behaviour:
Relative path starts with a slash
Absolute path have a double slash after the source or target directory.

Is it a bug or am I doing something wrong ?

lsyncd.conf

----
-- User configuration file for lsyncd.
--
settings {
   pidfile = "/var/run/coremedia/lsyncd.pid",
   logfile = "/var/log/lsyncd/lsyncd.log",
   statusFile = "/var/log/lsyncd/lsyncd.status",
   maxProcesses = 3,
}

-----
-- for testing purposes. just echos what is happening.
--
echo = {
        maxProcesses = 1,
        delay = 1,
        onStartup = "/bin/echo telling about ^source",
        onAttrib  = "/bin/echo attrib: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname.",
        onCreate  = "/bin/echo create: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname.",
        onDelete  = "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname.",
        onModify  = "/bin/echo modify: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname.",
        onMove    = "/bin/echo move ^o.pathname -> ^d.pathname",
}

sync {
  echo,
  source = "/mnt/upload/master",
  target = "/mnt/upload/prod",
}

and this is the log i get:
lsyncd.log

Tue Feb  9 17:26:56 2016 Normal: Startup of "/mnt/upload/master/" finished.
Tue Feb  9 17:27:01 2016 Normal: Event Modify spawns action "/bin/echo modify: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
modify: sourcePathname is /mnt/upload/master//test-file.txt1, path is /test-file.txt1, pathname is /test-file.txt1.
Tue Feb  9 17:27:01 2016 Normal: Retrying Modify on /mnt/upload/master//test-file.txt1 = 0
Tue Feb  9 17:31:55 2016 Normal: Event Create spawns action "/bin/echo create: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
create: sourcePathname is /mnt/upload/master//.test-file.txt.swp, path is /.test-file.txt.swp, pathname is /.test-file.txt.swp.
Tue Feb  9 17:31:55 2016 Normal: Retrying Create on /mnt/upload/master//.test-file.txt.swp = 0
Tue Feb  9 17:31:55 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
delete: sourcePathname is /mnt/upload/master//.test-file.txt.swx, path is /.test-file.txt.swx, pathname is /.test-file.txt.swx.
Tue Feb  9 17:31:55 2016 Normal: Retrying Delete on /mnt/upload/master//.test-file.txt.swx = 0
Tue Feb  9 17:31:58 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
delete: sourcePathname is /mnt/upload/master//4913, path is /4913, pathname is /4913.
Tue Feb  9 17:31:58 2016 Normal: Retrying Delete on /mnt/upload/master//4913 = 0
Tue Feb  9 17:31:58 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
Tue Feb  9 17:31:58 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
delete: sourcePathname is /mnt/upload/master//test-file.txt~, path is /test-file.txt~, pathname is /test-file.txt~.
Tue Feb  9 17:31:58 2016 Normal: Retrying Delete on /mnt/upload/master//test-file.txt~ = 0
delete: sourcePathname is /mnt/upload/master//test-file.txt, path is /test-file.txt, pathname is /test-file.txt.
Tue Feb  9 17:31:58 2016 Normal: Retrying Delete on /mnt/upload/master//test-file.txt = 0
Tue Feb  9 17:31:58 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
delete: sourcePathname is /mnt/upload/master//.test-file.txt.swp, path is /.test-file.txt.swp, pathname is /.test-file.txt.swp.
Tue Feb  9 17:31:58 2016 Normal: Retrying Delete on /mnt/upload/master//.test-file.txt.swp = 0
Tue Feb  9 17:32:05 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
Tue Feb  9 17:32:05 2016 Normal: Event Create spawns action "/bin/echo create: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
create: sourcePathname is /mnt/upload/master//new-file.txt, path is /new-file.txt, pathname is /new-file.txt.
Tue Feb  9 17:32:05 2016 Normal: Retrying Create on /mnt/upload/master//new-file.txt = 0
delete: sourcePathname is /mnt/upload/master//test-file.txt, path is /test-file.txt, pathname is /test-file.txt.
Tue Feb  9 17:32:05 2016 Normal: Retrying Delete on /mnt/upload/master//test-file.txt = 0
Tue Feb  9 17:32:11 2016 Normal: Event Delete spawns action "/bin/echo delete: sourcePathname is ^sourcePathname, path is ^path, pathname is ^pathname."
delete: sourcePathname is /mnt/upload/master//new-file.txt, path is /new-file.txt, pathname is /new-file.txt.
Tue Feb  9 17:32:11 2016 Normal: Retrying Delete on /mnt/upload/master//new-file.txt = 0
@jtognazzi jtognazzi changed the title relative path ^pathname start with a slash !? relative path ^pathname starts with a slash !? Feb 10, 2016
@jtognazzi
Copy link
Author

For the record, to workaround my issue, I simply added add "." in front of the variable...

@axkibe axkibe reopened this Mar 9, 2016
@axkibe
Copy link
Collaborator

axkibe commented Mar 9, 2016

Its still confusing I suppose.

@gdewey
Copy link

gdewey commented May 30, 2016

I am having the same issue.. when deleting in source I get this

Mon May 30 16:42:38 2016 Normal: Deleting list
/home/ubuntu/target//hola.txt
Permission denied (publickey).

where permission denied because there is a double slash between the target and the file name.

if I restart the service they will get in sync..

for me its like a bug.. did you got any solution on this jtognazzi ?

@axkibe
Copy link
Collaborator

axkibe commented May 30, 2016

whatever your issue is, I doubt it is the double //

This shouldn't hurt try ls.////// in a shell for example.

@axkibe
Copy link
Collaborator

axkibe commented May 30, 2016

I suppose you're using default.rsyncssh not default.rsync and your rsync channel works, but your ssh channel doesn't. Easiest solution is to use plain default.rsync.

@gdewey
Copy link

gdewey commented May 30, 2016

well "onDelete" I get

/home/ubuntu/target//hola.txt
Permission denied (publickey).

but when restart the deamon I get

sending incremental file list
deleting hola.txt
./
and it does delete it. So I assume there is no public key or permission problem but ssh trying to delete /home/ubuntu/target//hola.txt and not /home/ubuntu/target/hola.txt
I am mannually running rsync to sync and ondelete it works..

is there a way to strip the // into / so I make sure this is not the issue?

thanks

@gdewey
Copy link

gdewey commented May 30, 2016

and yes I am using default.rsyncssh .. let me try using srync and change the path to a remote server and see if it does it

@axkibe
Copy link
Collaborator

axkibe commented May 30, 2016

The double slash is 99.9% sure not the issue

Try running as user Lsyncd is running with "ssh [target] touch x"

@gdewey
Copy link

gdewey commented May 30, 2016

well I gave a shot on not using the syncssh and use the default and it works as as charm

here is my final setting to share in case someone uses amazon ec2 and needs to use file authentication

settings {

    logfile = "/var/log/lsyncd/lsyncd.log",
    statusFile = "/var/log/lsyncd/lsyncd.status",
    delay = 0,

}

sync {
default.rsync,
source = "/home/ubuntu/source",
target = "ubuntu@serverip:/home/ubuntu/target",

    rsync = {

         archive = true,
         compress = true,
         owner = true, 
         perms = true,
         verbose = true,
         acls = true,
         rsh = "ssh -i /home/ubuntu/cert/key.pem"

       },    

   }

@axkibe
Copy link
Collaborator

axkibe commented Jan 4, 2017

This has been changed with Lsyncd 2.2.0

@axkibe axkibe closed this as completed Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants