hnsl / unox

Unison OS X unison-fsmonitor adapter.
101 stars 12 forks source link

Cross-OS watching? #6

Closed ezequiel closed 9 years ago

ezequiel commented 9 years ago

@hannes-landeholm Thanks for unox!

I'm attempting to perform a unison -repeat watch from a Mac OS X machine to a Linux machine. I'm currently wondering if this is possible? I attempted it, and it doesn't seem to be-- unless I'm doing something wrong.

Mac OS X uses unox as its unison-fsmonitor. Linux is using the default unison-fsmonitor that came with it upon installation.

When I run unison, I get this error: fatal error: Server: Unexpected response 'Usage: unison-fsmonitor [options] root [path] [path]...' from the filesystem watcher (expected VERSION)

I quickly scanned unox's code, and it seems to forcibly throw an error if the versions mismatch.

Any help is very much appreciated!

// cc @wamatt

hnsl commented 9 years ago

What does unison -version say? You need to use at least 2.48 on both machines.

ezequiel commented 9 years ago

@hannes-landeholm

unison -version on both machines return: unison version 2.48.3 (just as a side note, both were compiled with ocamlc 4.01.0).

I run unison ssh://mylinuxserver.com/www ~/Desktop/www -repeat watch and the log looks like:

Connected [...]
Looking for changes
  Waiting for changes from server
Fatal error: Server: Unexpected response 'Usage: unison-fsmonitor [options] root [path] [path]...' from the filesystem watcher (expected VERSION)

unox looks like it throws the error if the the versions of unison-fsmonitor mismatch?

ezequiel commented 9 years ago

Hm... I'm getting closer. I've gotten past the above error. Will update in a bit.

hnsl commented 9 years ago

Oh, it looks like your unison is not executing the correct unison-fsmonitor. It doesn't execute unox at all, check that unox can be executed properly with the environment PATH you have configured.

hnsl commented 9 years ago

You can check that unox starts by typing unison-fsmonitor in your command line. It should print VERSION 1.

ezequiel commented 9 years ago

@hannes-landeholm That was the issue. D'oh. Thanks for your help!

MartinPeverelli commented 8 years ago

@hnsl @ezequiel I'm getting the same error as described here

$ unison ssh://vagrant@192.168.10.10//home/vagrant/www ~/unison/www -repeat watch

Produces the followin output

Contacting server...
Connected [...]
Looking for changes
  Waiting for changes from server
Fatal error: Server: Unexpected response 'Usage: unison-fsmonitor [options] root [path] [path]...' from the filesystem watcher (expected VERSION)

On my localhost:

$ unison -version
unison version 2.48.3
$ unison-fsmonitor
VERSION 1

On my VM:

$ unison -version
unison version 2.48.3
$ unison-fsmonitor
Usage: unison-fsmonitor [options] root [path] [path]...
This program monitors file system changes on all given (relative to root) paths
and dumps paths (relative to root) files to a file. When launched, this file is
recreated. While running new events are added. This can be read by UNISON
to trigger a sync on these files. If root is a valid unison profile, we attempt
to read all the settings from there.

For my localhost, I installed unison via homebrew, and downloaded the unox.py file to /usr/local/bin/unison-fsmonitor For my VM, I used ppa:eugenesan/ppa for unison, and downloaded the source, to get a copy of fsmonitor.py, which I placed under /usr/bin/unison-fsmonitor

Unison without -repeat watch works without issues. Any ideas?

MartinPeverelli commented 8 years ago

Resolved here: http://unix.stackexchange.com/questions/275434/running-unison-repeat-watch-yields-filesystem-watcher-error

Turns out, its not clear what the purpose of the source fsmonitor.py script is... but when compiling form source, you get both unison and unison-fsmonitor, and after placing those binaries on the PATH, unison works without issues.