Lipsync on archlinux

48 views
Skip to first unread message

bacardi55

unread,
Apr 29, 2011, 3:35:33 AM4/29/11
to project-lipsync
Hi all,

I just found out this project and I'm verry interested :)
Only problem is that my server is running Debian but my laptop is
running archlinux.

Archlinux doesn't use init.d but rc.d. I really don't know if there is
a lot of difference between a rc.d script and a init.d script. I'm not
a bash developper at all (more a C dev for opensource project like
wmfs or web developper) so i'll do my best to make it work :)

I'll try to found out today beause that's the only thing that doesn't
work in the install.sh.

If some of you already did it, feel free to help me :p.
I'll post the new script if I manage to make it work :)

Thanks for this piece of software!

PS : sorry for my poor english :)

phil cryer

unread,
Apr 29, 2011, 10:51:23 AM4/29/11
to project...@googlegroups.com
Hey, welcome, thanks for taking a look. You bringing this up, and me looking at the work on the OSX port made me think more about this today; this is why I changed the script to check if we were running Linux or OSX, not looking for Debian or Red Hat or whatever - it really needs to be more universal to just work with any Linux. I know Debian are pretty headstrong in their opinions on where things should live, but it seems that that occurs when they're installing something as a .deb. So, what is a general way to do this? Have it as a standalone rc script? Is the init.d script something that could work as that? I think that's how I did it back in the Slackware days, but honestly, after working in FreeBSD for years, I've been all Ubuntu/Debian so I don't know. Again, I'd like a script we could use in any Linux, as well as in OSX - perhaps it gets installed to a different directory or something (just like if we get this rolling in Windows/cgywin it would be in C:\cygwin\usr\local\bin or the like... )

What is the general/accepted way of doing this? Could we just use the scripts in /usr/local/bin and then drop a line in rc.local to handle it on boot - that doesn't seem completely integrated, but if it would work for *everyone* I'd prefer it, and again, we could modify it for different distros/platforms later. I'd just much rather have one script that will work anywhere, again, maybe we'll have some if `uname -a` == whatever logic, but just think about support, much easier to fix something in one script than in multiple ones. Thoughts?

Thanks again, and please don't worry about your English, it's excellent - let me apologize for not learning any other languages!

P

bacardi55

unread,
Apr 29, 2011, 12:13:41 PM4/29/11
to project-lipsync
Hi again,

On Apr 29, 4:51 pm, phil cryer <p...@cryer.us> wrote:
> Hey, welcome, thanks for taking a look. You bringing this up, and me looking
> at the work on the OSX port made me think more about this today; this is why
> I changed the script to check if we were running Linux or OSX, not looking
> for Debian or Red Hat or whatever - it really needs to be more universal to
> just work with any Linux. I know Debian are pretty headstrong in their
> opinions on where things should live, but it seems that that occurs when
> they're installing something as a .deb. So, what is a general way to do
> this? Have it as a standalone rc script? Is the init.d script something that
> could work as that? I think that's how I did it back in the Slackware days,
> but honestly, after working in FreeBSD for years, I've been all
> Ubuntu/Debian so I don't know. Again, I'd like a script we could use in any
> Linux, as well as in OSX - perhaps it gets installed to a different
> directory or something (just like if we get this rolling in Windows/cgywin
> it would be in C:\cygwin\usr\local\bin or the like... )
>
> What is the general/accepted way of doing this? Could we just use the
> scripts in /usr/local/bin and then drop a line in rc.local to handle it on
> boot - that doesn't seem completely integrated, but if it would work for
> *everyone* I'd prefer it, and again, we could modify it for different
> distros/platforms later. I'd just much rather have one script that will work
> anywhere, again, maybe we'll have some if `uname -a` == whatever logic, but
> just think about support, much easier to fix something in one script than in
> multiple ones. Thoughts?

Unfortunatly, I don't know… I don't know anything about init.d script
or
rc.d … I'd love to help though so I'll look into it this week end!

anyway, i didn't manage yet to run a /etc/rc.d/lipsync start but i
tried
launching the command in the cron.d directory. It seems that the rsync
worked in the wrong way (it deleted all files from my laptop directory
cause there weren't on the server. Maybe i understand lipsync in the
wrong way…
Moreover, I already have a ssh key but i'm using a ssh key with a
passphrase… i couldn't indicate an other ssh key (without a
passphrase)
so it seems i have to create a specific user wich is a shame (for my
point of view).

Anyway, i'll try to understand it and make it work this week end.

Thanks again! :-)
--
bacardi55

phil cryer

unread,
Apr 29, 2011, 2:51:39 PM4/29/11
to project...@googlegroups.com
> Unfortunatly, I don't know… I don't know anything about init.d script or
> rc.d … I'd love to help though so I'll look into it this week end!

Cool, I'll do the same, again, I'd rather have something that worked for everyone

> anyway, i didn't manage yet to run a /etc/rc.d/lipsync start

Not sure how that would go, if paths for some of the required things were different, should have spit out something to the logs in ~/.lipsync/lipsync.log

> but i tried launching the command in the cron.d directory. It seems that the rsync
> worked in the wrong way (it deleted all files from my laptop directory
> cause there weren't on the server. Maybe i understand lipsync in the

Yep, that's actually by design for now...the Lipsyncd process watches for changes locally and then sync's them to the server, but to get updates from the server we run that outta cron every 5 mins. Ideally Lipsyncd will watch for changes, kick off and sync them to the server when there are changes, and after that kick this 'reverse' script to get changes from the server. Then Cron is still around in case files don't change on the client, but things get updated on the server, say from another client.

> Moreover, I already have a ssh key but i'm using a ssh key with a
>passphrase… i couldn't indicate an other ssh key (without a
> passphrase) so it seems i have to create a specific user wich is a shame (for my

I have an 'issue' to solve, should be quick, so we'll create a new key with lipsync in the name (lipsync.ida or something) so you can swap those out interdependently of any keys you might already have. You shouldn't have to create a specific user though, I've had keys move from user to user (they had the same name, but..) and work. I had to do this for working with github with multiple clients. If you create a new key: ~/.ssh/lipsync_dsa and put that on the server either via ssh-copy-id, or the long way I had in the setup script it should work, again, this is something that needs to be stonger, let me take a crack at it over the weekend too.

Thanks

P
--
http://philcryer.com

bacardi55

unread,
May 2, 2011, 1:36:45 PM5/2/11
to project-lipsync
Hi,

Sorry, I wasn't able to work on lipsync this week end…

On Apr 29, 8:51 pm, phil cryer <p...@cryer.us> wrote:
> > Unfortunatly, I don't know… I don't know anything about init.d script or
> > rc.d … I'd love to help though so I'll look into it this week end!
>
> Cool, I'll do the same, again, I'd rather have something that worked for
> everyone

I finally manage to make a rc.d script work on archlinux.
Please find here http://bacardi55.org/55/lipsync/ the etc folder
(etc.tgz) with a rc.d folder inside
and the install.sh.tgz that I changed to make it works.

I saw in your install script that your lsync is in /usr/local/bin/
whereas mine is in /usr/bin/ .
That's why I changed the path to result of the command line : "which
lsync"
to let the script find the path of lsync.

I you prefer, I can fork lipsync on github to make it easier for you
to see all differences
(but it will be tomorrow)

Now that I changed install.sh and the rc.d script, I manage to start
lipsync
with /etc/rc.d/lipsync start

That's the good news, the bad news is :

I tried to sync some files between the server and my laptop.
Just to make it clear, here is what I did :
I didn't install anything on the server other than rsync and ssh
I installed lipsync and lsync on my laptop and configured it.
Again, just to be really clear :
cat /etc/lipsyncd
USER_NAME=**** #user name that exists on both machines
LOCAL_DIR=/home/****/sync/test/ # dir on MY SERVER
REMOTE_HOST=***.********.org
REMOTE_DIR=/home/****/test # dir on MY LAPTOP (client)
SSH_PORT=****

The client is my laptop where i'm working, and the server is where
i won't touch the files.
For now, the only thing that works is when I launch /usr/local/bin/
lipsync
(the cron command), all my files on my laptop are removed.

I don't manage to send file from my client (laptop) to my server. Im
guessing
that it's because it can't use my ssh key that need a passphrase but
i'm not sure
cause i don't see that in the log.
The log file tells me this :
Mon May 02 19:23:02 2011 Cron: updated kim.bacardi55.org -> arch55
Mon May 02 19:23:33 2011 Daemon: lipsyncd is stopping
2011/05/02 19:24:02 [24125] receiving file list
2011/05/02 19:24:02 [24135] Number of files: 1
2011/05/02 19:24:02 [24135] Number of files transferred: 0
2011/05/02 19:24:02 [24135] Total file size: 0 bytes
2011/05/02 19:24:02 [24135] Total transferred file size: 0 bytes
2011/05/02 19:24:02 [24135] Literal data: 0 bytes
2011/05/02 19:24:02 [24135] Matched data: 0 bytes
2011/05/02 19:24:02 [24135] File list size: 36
2011/05/02 19:24:02 [24135] File list generation time: 0.001 seconds
2011/05/02 19:24:02 [24135] File list transfer time: 0.000 seconds
2011/05/02 19:24:02 [24135] Total bytes sent: 11
2011/05/02 19:24:02 [24135] Total bytes received: 50
2011/05/02 19:24:02 [24135] sent 11 bytes received 50 bytes 40.67
bytes/sec
2011/05/02 19:24:02 [24135] total size is 0 speedup is 0.00
Mon May 02 19:24:02 2011 Cron: updated kim.bacardi55.org -> arch55

(/var/log/lipsyncd is empty)

I hope that this is helpful!
If you need any other details, don't hesitate :)

--
bacardi55

bacardi55

unread,
May 3, 2011, 4:27:22 AM5/3/11
to project-lipsync
I forked lipsync on github to add my files :
https://github.com/bacardi55/lipsync/commit/f9b5f7e81daedca24d63b91cf1f26dc3d773854a

On May 2, 7:36 pm, bacardi55 <bacard...@gmail.com> wrote:
> Hi,
>
> Sorry, I wasn't able to work on lipsync this week end…
>
> On Apr 29, 8:51 pm, phil cryer <p...@cryer.us> wrote:
>
> > > Unfortunatly, I don't know… I don't know anything about init.d script or
> > > rc.d … I'd love to help though so I'll look into it this week end!
>
> > Cool, I'll do the same, again, I'd rather have something that worked for
> > everyone
>
> I finally manage to make a rc.d script work on archlinux.
> Please find herehttp://bacardi55.org/55/lipsync/the etc folder

phil cryer

unread,
May 6, 2011, 8:08:45 PM5/6/11
to project...@googlegroups.com
This looks great, I'll take a look at it soon, I appreciate the help!

- I'll take a look at the rc script, thanks for including that
- I defaulted to /usr/local/bin because that's where lysncd defaulted
to for their binary..hmmm,
- for logs, take a look at /home/USER/.lipsync/lipsync.log
- i've changed the setup script so it does an equal sync during
install of the client and server, that way neither 'wins' on the first
run and clear out a bunch of files! (sorry!)
- are you sure you're running lsyncd2.x? Take a look at the logs

Let me know if you're still having trouble, and we'll see what we can do.

P

--
http://philcryer.com

bacardi55

unread,
May 8, 2011, 8:02:43 AM5/8/11
to project-lipsync
Hi,

On 7 mai, 02:08, phil cryer <p...@cryer.us> wrote:
> This looks great, I'll take a look at it soon, I appreciate the help!
>
> - I'll take a look at the rc script, thanks for including that
> - I defaulted to /usr/local/bin because that's where lysncd defaulted
> to for their binary..hmmm,
Ok, maybe the packager of the aur packet on archlinux has changed it
on my distrib'...

> - for logs, take a look at /home/USER/.lipsync/lipsync.log
I pasted it in my mail, the only message was that lipsync is
launched...

> - i've changed the setup script so it does an equal sync during
> install of the client and server, that way neither 'wins' on the first
> run and clear out a bunch of files! (sorry!)
Ok, I'll try that tomorrow :)

> - are you sure you're running lsyncd2.x? Take a look at the logs
Yes, it is a 2.x version.

>
> Let me know if you're still having trouble, and we'll see what we can do.
>
> P
>
>
>
> On Tue, May 3, 2011 at 3:27 AM, bacardi55 <bacard...@gmail.com> wrote:
> > I forked lipsync on github to add my files :
> >https://github.com/bacardi55/lipsync/commit/f9b5f7e81daedca24d63b91cf...
>
> > On May 2, 7:36 pm, bacardi55 <bacard...@gmail.com> wrote:
> >> Hi,
>
> >> Sorry, I wasn't able to work on lipsync this week end…
>
> >> On Apr 29, 8:51 pm, phil cryer <p...@cryer.us> wrote:
>
> >> > > Unfortunatly, I don't know… I don't know anything about init.d script or
> >> > > rc.d … I'd love to help though so I'll look into it this week end!
>
> >> > Cool, I'll do the same, again, I'd rather have something that worked for
> >> > everyone
>
> >> I finally manage to make a rc.d script work on archlinux.
> >> Please find herehttp://bacardi55.org/55/lipsync/theetc folder
Reply all
Reply to author
Forward
0 new messages