axkibe/lsyncd — Issue #104: lsyncd with ssh keys and other ssh options
Author: ashak
Created: 2011-12-22 10:01:57+00:00
State: open

Hi,

This isn't an obvious issue as such, more either a failure with my understanding or a lack of the obvious documentation.

I'm running lsyncd 2.0.4 on Ubuntu, i'm trying to rsync with a specific ssh key and some extra ssh options.

My config looks like this:
# cat /etc/lsyncd/lsyncd.conf.lua
sync {
default.rsync,
source="/path/to/some/local/files/",
target="username@hostname:/path/to/remote/files",
rsyncOps="-e '/usr/bin/ssh -i /path/to/ssh/key -o StrictHostKeyChecking=no'",
}

However, lsynd logs the following (which seems to be rsync complaining):
09:55:58 Function: Inotify.addWatch(/path/to/some/local/files/, (true), (nil), (nil))
09:55:58 Inotify: addwatch(/path/to/some/local/files/)->1
09:55:58 Normal: recursive startup rsync: /path/to/some/local/files/ -> username@hostname:/path/to/remote/files/
09:55:58 Exec: /usr/bin/rsync [--delete] [-e '/usr/bin/ssh -i /path/to/ssh/key -o StrictHostKeyChecking=no'] [-r] [/path/to/some/local/files/] [username@hostname:/path/to/remote/files]
09:55:58 Call: getAlarm()
09:55:58 Debug: getAlarm returns: (false)
09:55:58 Masterloop: going into select (no timeout).
rsync: Failed to exec /usr/bin/ssh -i /path/to/ssh/key -o StrictHostKeyChecking=no: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.7]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(601) [sender=3.0.7]

Which suggests that rsync is trying to exec '/usr/bin/ssh -i /path/to/ssh/key -o StrictHostKeyChecking=no' and failing because obviously there's no such file or directory with all that as its name, most of it is arguments to ssh.

FWIW, if I copy and paste the rsync line above into a terminal and remove all the square brackets, then the rsync command works fine and does exactly what i'm expecting it to do.

So i'm kinda stuck.

Any ideas? :)

Thanks