OSX / overview?

24 views
Skip to first unread message

Damian

unread,
Apr 11, 2011, 4:28:01 PM4/11/11
to project-lipsync
hey folks,

I want to get this working under OSX. After hacking about a bit I have
a running lsyncd v2, but obviously the init.d scripts from lipsync are
not going to be much help to me on OSX, and thus nor is the
install.sh.

But first, I want to make sure I actually understand what lipsync is.
It seems to be the following:

1. Each client runs lsyncd to push stuff to the server.
2. Each client periodically runs lipsync, which is a wrapper around an
rsync command to pull stuff from the server to the client.
3. The server is set up for password-less login using .ssh/
authorized_keys.

This is everything? Am I missing something? If two clients are pushing
and pulling to and from the server at the same time, how do the
different rsyncs (one instantiated by lsyncd, one instantiated by
lipsync) not get tangled up in a heap?

Looking in bin/lipsync on github, this confused me:

rsync -r -a -v -e "ssh -l $USER_NAME" --delete $REMOTE_HOST:$LOCAL_DIR
$REMOTE_DIR

Shouldn't that be $REMOTE_HOST:$REMOTE_DIR $LOCAL_DIR ?

cheers,
D

goozbach

unread,
Apr 11, 2011, 4:34:04 PM4/11/11
to project-lipsync
On Apr 11, 4:28 pm, Damian <damian.stew...@gmail.com> wrote:
> hey folks,
>
> I want to get this working under OSX. After hacking about a bit I have
> a running lsyncd v2, but obviously the init.d scripts from lipsync are
> not going to be much help to me on OSX, and thus nor is the
> install.sh.
>

Damian,

I think the changes I'm working on currently[1] will allow lipsync to
run just fine under OSX if you've got lsyncd v2 running.

I'm about 60-70% through converting lipsyncd from an init script to a
daemon which is ran from your shell startup scripts.

When it's working correctly I'll be submitting a pull-request to the
main repo as well as writing an RPM for Fedora and a dpkg for debian/
ubuntu with a PPA.

[1]: https://github.com/goozbach/lipsync/tree/profile
--
Derek aka goozbach

Phil Cryer

unread,
Apr 12, 2011, 12:33:31 PM4/12/11
to project...@googlegroups.com, goozbach
On Mon, Apr 11, 2011 at 3:34 PM, goozbach <frio...@gmail.com> wrote:
> On Apr 11, 4:28 pm, Damian <damian.stew...@gmail.com> wrote:
>> hey folks,
>>
>> I want to get this working under OSX. After hacking about a bit I have
>> a running lsyncd v2, but obviously the init.d scripts from lipsync are
>> not going to be much help to me on OSX, and thus nor is the
>> install.sh.
>>

Nice, so I know lsyncd2 will work under OSX, what do you need to use
in place of inotify? (I know BSD has something, can't recall it...)

P

>
> Damian,
>
> I think the changes I'm working on currently[1] will allow lipsync to
> run just fine under OSX if you've got lsyncd v2 running.
>
> I'm about 60-70% through converting lipsyncd from an init script to a
> daemon which is ran from your shell startup scripts.
>
> When it's working correctly I'll be submitting a pull-request to the
> main repo as well as writing an RPM for Fedora and a dpkg for debian/
> ubuntu with a PPA.
>
> [1]: https://github.com/goozbach/lipsync/tree/profile
> --
> Derek aka goozbach
>

--
http://philcryer.com

Damian

unread,
Apr 12, 2011, 1:34:15 PM4/12/11
to project-lipsync
it

On Apr 12, 6:33 pm, Phil Cryer <phil.cr...@gmail.com> wrote:

Damian

unread,
Apr 12, 2011, 1:34:52 PM4/12/11
to project-lipsync
it's using fsevents, which unfortunately is a private API and subject
to change at any point. it already works with 10.5 and i've just
submitted a patch for 10.6.

On Apr 12, 6:33 pm, Phil Cryer <phil.cr...@gmail.com> wrote:

Phil Cryer

unread,
Apr 12, 2011, 1:40:43 PM4/12/11
to project...@googlegroups.com, Damian
Interesting I thought kqueue was the way to go, this thread from
dropbox forums list seems to agree with your comment

"I won't say for sure, but I don't think we're using kqueue. What we
are using, are the fseventsd and our own dbfseventsd on Mac OS.
However, even if it's not hard, it'll take time and resources. Two
things which are very scarce, as we have lots and lots of features and
improvements that needs to be added to the Dropbox client. ;-)"

http://forums.dropbox.com/topic.php?page=2&id=5627&replies=59

what is the difference between the two, and why does 10.5 have it but not 10.6?

Thanks for the info

P

--
http://philcryer.com

Damian

unread,
Apr 12, 2011, 2:14:15 PM4/12/11
to project-lipsync
On Apr 11, 10:34 pm, goozbach <frioco...@gmail.com> wrote:
> Damian,
>
> I think the changes I'm working on currently[1] will allow lipsync to
> run just fine under OSX if you've got lsyncd v2 running.
>
> I'm about 60-70% through converting lipsyncd from an init script to a
> daemon which is ran from your shell startup scripts.

sounds great!

i'm not sure if you're planning on keeping the setup script as-is but
FYI OSX has no ssh-copy-id.

other than that -- what's left to do? need some help?

cheers
d

Phil Cryer

unread,
Apr 12, 2011, 3:35:48 PM4/12/11
to project...@googlegroups.com, Damian
On Tue, Apr 12, 2011 at 1:14 PM, Damian <damian....@gmail.com> wrote:
> On Apr 11, 10:34 pm, goozbach <frioco...@gmail.com> wrote:
>> Damian,
>>
>> I think the changes I'm working on currently[1] will allow lipsync to
>> run just fine under OSX if you've got lsyncd v2 running.
>>
>> I'm about 60-70% through converting lipsyncd from an init script to a
>> daemon which is ran from your shell startup scripts.
>
> sounds great!
>
> i'm not sure if you're planning on keeping the setup script as-is but
> FYI OSX has no ssh-copy-id.

We could have the script check that ssh-copy-id is in the $PATH and if
not use an old way with SSH and cat:
http://fak3r.com/geek/howto-passwordless-ssh-logins/

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | ssh REMOTE_SERVER 'cat - >> ~/.ssh/authorized_keys'
ssh REMOTE_SERVER 'chmod 700 .ssh'
ssh REMOTE_SERVER

Also count me in for testing OSX, that would be great, would be nice
to have the script setup either depending on where it was run.

P

> other than that -- what's left to do? need some help?
>
> cheers
> d
>

--
http://philcryer.com

goozbach

unread,
Apr 12, 2011, 3:55:38 PM4/12/11
to project-lipsync
On Apr 12, 3:35 pm, Phil Cryer <phil.cr...@gmail.com> wrote:

> > i'm not sure if you're planning on keeping the setup script as-is but
> > FYI OSX has no ssh-copy-id.
>
> We could have the script check that ssh-copy-id is in the $PATH and if
> not use an old way with SSH and cat:http://fak3r.com/geek/howto-passwordless-ssh-logins/
>

I've already ported ssh-copy-id to OSX. So we could just include
that.

https://github.com/goozbach/ssh-copy-id

+1 to only use it if not in $PATH

--
Derek

Damian Stewart

unread,
Apr 12, 2011, 2:12:57 PM4/12/11
to ph...@cryer.us, project...@googlegroups.com, Damian
i'm not totally sure what the difference is between kqueue and fsevents, i just know that lsyncd already had a working fsevents with OSX 10.5 so that seemed to be the path of least resistance :-)

10.6 has it (it's how Spotlight and Time Machine work). lsyncd should have worked fine -- the problem seems to be that the /dev/fsevents device is still spitting out 32-bit aligned data (working from a struct layout in the 10.5 kernel sources at vfs_events.c) on 10.6, even if the kernel is running 64 bit, which leads to alignment errors if you just slurp that up and try and cast it as a struct.

d

Sergio Kokouvi AFANOU

unread,
Apr 19, 2011, 3:50:36 PM4/19/11
to project-lipsync
Hey folks,

I've been following the threads since the begining but I must admit
that I have some issues involving in modifications as I don't have a
clear knowledge of the architecture of the project. I've understood
that :

- there is a git repository at http://philcryer.github.com/lipsync/
and the code is versionned there
- here is the project discussion group
- on the repo there is a docs folder containing a readme, the tool's
diagram and a changelog
- we use rsync and lsyncd and cron job for files synchronization (not
unison anymore)
- the same user must be created on each client to be able to sync
(though a read a post on porting the tool on fedora that suggest not
to)

Do we have a Todo-List somewhere ? I would like to have an idea of
what improvements we need to do and start working on some points (to
avoid developping an already developped feature).

What is our strategy for porting the project to other platforms ?
(Debian, Fedora, Ubuntu, OSX, even Windows) ?

Do we have a diagram of the architecture of the tool (which tools are
used, rsync, lsyncd, ssh etc, the location of the config files and
user configuration, cron job stuff ...) ?

Thanks all.

Regards,

phil cryer

unread,
Apr 20, 2011, 12:00:00 PM4/20/11
to project...@googlegroups.com
Hey Sergio, thanks for the questions, let me see if I can answer some,
then maybe some others can chime in:

On Tue, Apr 19, 2011 at 2:50 PM, Sergio Kokouvi AFANOU
<afanou...@gmail.com> wrote:
> Hey folks,
>
> I've been following the threads since the begining but I must admit
> that I have some issues involving in modifications as I don't have a
> clear knowledge of the architecture of the project. I've understood
> that :
>
>  - there is a git repository at http://philcryer.github.com/lipsync/
> and the code is versionned there

Yes, but I think the main base link should be here:
https://github.com/philcryer/lipsync
and I need to redo the one at http://philcryer.github.com/lipsync/ -
since it's not as up to date as the readme. I may just make it into a
better looking webpage that lists the download links, then links to
the Readme/install page and the License for poeple that just want to
download it and don't understand git.

>  - here is the project discussion group

Yes

>  - on the repo there is a docs folder containing a readme, the tool's
> diagram and a changelog

Yes

>  - we use rsync and lsyncd and cron job for files synchronization (not
> unison anymore)

Yes

>  - the same user must be created on each client to be able to sync
> (though a read a post on porting the tool on fedora that suggest not
> to)

Correct, right now I haven't gotten into this, or the use of
multi-users on the same system, but I think we should plan for both of
these soon.

> Do we have a Todo-List somewhere ? I would like to have an idea of
> what improvements we need to do and start working on some points (to
> avoid developping an already developped feature).

I started a TODO in the docs directory, but that didn't feel very
co-operative of me, so I've started entering new ideas for
features/enhancements as 'issues'. Please feel free to enter some -
and notice it has a note about multiple users, which I may start on
next week.
https://github.com/philcryer/lipsync/issues

Now this could also be used for bug reports - if you can find any!
Haha, just kidding everyone, really, thanks, I'll be here all week! :)

> What is our strategy for porting the project to other platforms ?
> (Debian, Fedora, Ubuntu, OSX, even Windows) ?

I originally tied it to Debian/Ubuntu since that's what i was using,
but honestly much of that was due to the crazy/different Unison
version numbers. Now using rsync I *think* it should be working on
Debian, Fedora, etc, and the script will just be checking if we're
running on Linux or Darwin (OSX), and eventually Cygwin probably. On
another thread someone had Lsyncd2 working on OSX, which I was not
able to find documented online, can someone verify this? If it runs,
and calls fevents or whatever OSX uses instead of inotify things
should/could work almost exactly the way it does in Linux, which would
make the install script work (with only minor 'if Dawin then..'
actions). I know someone mentioned that in Windows there's some .NET
library than can watch for events, but that sounds like a heavy
requirement - we'll see.

> Do we have a diagram of the architecture of the tool (which tools are
> used, rsync, lsyncd, ssh etc, the location of the config files and
> user configuration, cron job stuff ...) ?

I put this together to try and describe it better
https://github.com/philcryer/lipsync/raw/master/docs/diagram.png then
yesterday I was passively testing the cron hooks to do part #3, and I
(still) need to get some permissions straightened out.

Thanks for your thoughts and questions, things are moving along. I'd
like to see OSX support as part of the default setup next, then attack
multi-user, then maybe cygwin? As always, I'm open to any ideas, and
please rock the issues link if you have anything you 'must have' or
start hacking on an issue, or whatever you'd like.

P

--
http://philcryer.com

Reply all
Reply to author
Forward
0 new messages