LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 07-31-2007, 12:32 PM   #1
hroit
Member
 
Registered: May 2006
Posts: 31

Rep: Reputation: 15
rsync works in one direction, but not the other


I've set up rsync between two connected boxes, but it only works in one direction between the two boxes.

rsync is set up to be started by xinetd when a call from a client reaches xinetd.

When I mirror from the laptop to the desktop, it works like a charm.
When I try to mirror from the desktop to the laptop, no dice.

This difference between the two directions occurs at the very beginning of the protocol, when trying to call the rsync daemon.
In the former, succesful case, initiation gives:
Code:
desktop$ rsync rsync://laptop_name
module           Module used to backup /files here, on laptop, to files/backup on desktop
namely, the name of the module and the comment on it. I can also go ahead and browse or mirror the whole directory in the module.

In the latter case, on the other hand:
Code:
laptop$ rsync rsync://desktop_name
simply gives rise to a blinking cursor. It just hangs there for as long as I let it, and nothing happens.

I've tried to look up the rsync.log on the daemon (on the desktop), but it has no trace of the call.
Likewise, the last line in /var/log/syslog (where xinetd logs to) is:
Code:
Jul 31 19:01:26 desktop_name xinetd[10363]: Started working: 0 available services
which means that xinetd is on, but unaware of the call from the laptop, as the rsync call occurred later...

Finally, here's another bit of data:

Code:
desktop$ rsync rsync://backup@localhost
rsync: failed to connect to localhost: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
So, the desktop won't rsync to itself.
The laptop, by contrast, will.

This suggests to me that port 873 isn't open on the desktop.
Two tests would be to try and rsync through ssh (port 22), but I don't know how to yet, or to open the port, which I don't know how to do yet either.

Other possibilities?
Help?

jackn

Last edited by hroit; 08-01-2007 at 01:18 AM.
 
Old 08-01-2007, 05:45 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,288

Rep: Reputation: 174Reputation: 174
well, it would seem rsync daemon isn't running on the desktop

check your installation documentation.

try looking for an rsync script in /etc/init.d
and start it manually as root
 
Old 08-01-2007, 10:08 PM   #3
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
probably your firewall setting, try to turn it off 1st?
 
Old 08-02-2007, 02:10 AM   #4
hroit
Member
 
Registered: May 2006
Posts: 31

Original Poster
Rep: Reputation: 15
Right on the money, bigearsbilly...

Here's the error message I would get when I simply tried to connect:

Code:
$ rsync rsync://desktop_name
rsync: failed to connect to desktop_name: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
Having run

Code:
sudo /etc/init.d/rsync start
on the desktop, I now get:

Code:
$ rsync rsync://desktop_name
module_name     Module set up to back up /files here, on desktop, to laptop.
$
This is wonderful, because this narrows down things quite a bit. It is clearly not a port issue, as when rsync is made to run, it communicates very well.

So, I could manually start rsync every time I wanted to run it.
Yet, it would be nicer to automate this (it's a backup task).

The rsync daemon is usually run through a super-server (inetd, xinetd) so as to avoid having a whole lot of servers listening to calls. I could simply have rsync permanently on, but it would be nice to get it to run upon calls.
In my case, I have set it up to be started by xinetd, which has worked very well on the laptop. It seems to be the default on Ubuntu, the distro I'm running.

So why doesn't the desktop's xinetd respond to calls, whereas the laptop's does?!

The xinetd daemon is permanently on:
Code:
$ ps aux | grep inetd
root      8942  0.0  0.1   2348   860 ?        Ss   07:48   0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive
And the inetd one isn't.

rsync figures in /etc/services with the 873 port and the tcp protocol assigned.

I have also set up an xinetd.d/rsync file, to have xinetd run rsync:
Code:
xinetd.d/rsync:
service rsync
    {
        disable         = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
    }
I have verified the path to rsync.

In short, I am not aware of any differences in the setup between the laptop and the desktop, yet the desktop's daemon won't respond to calls, whereas the laptop's will.
It looks like either an xinetd issue, or sth to do with its starting rsync. rsync itself clearly works just fine.

Another thing I could do is use inetd, instead of xinetd, to start rsync. This would be a workaround I could live with very well. I'm just not fully sure about how to go about it (launch inetd through .bashrc?), and I'd rather use what the distro uses by default, which might prevent other conflicts in the future. What do you think? Also, it would be nice to figure out why the desktop's xinetd doesn't respond to calls.

Thank you very much, kstan and bigearsbilly, for your ideas and information.

jackn
 
Old 08-02-2007, 03:24 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,288

Rep: Reputation: 174Reputation: 174
wow I was right

to be honest I haven't had or heard of any sort of problem ever with (x)inetd
not working. though generally i think I use inetd. (I just go with default
setup).
I would think it better first to check if the startup scripts are
1. enabled (check your sysadmin guide for your distro)
2. being called and operating correctly,

I would think this more likely.

It's not unknowm for different machines to configure differently in my experience.
maybe they feel a laptop is more likely to need rsync than a desktop so it's disabled on the desktop enabled if a laptop? Possible.
 
Old 08-02-2007, 11:57 PM   #6
hroit
Member
 
Registered: May 2006
Posts: 31

Original Poster
Rep: Reputation: 15
Yes, indeed, it's the setup of rsync.

In Ubuntu, at least, you need to set RSYNC_ENABLE (in /etc/defaults/rsync) to True...
I set it to 'true'...

Since one machine, with the same setup apparently, was OK, and the other not, my next move was to run diff on each of the config files, which would have come up with the culprit...

But then I finally noticed the error message upon shutdown, telling me the variable above could only be set up to True or False...
Even then it took a while for it to dawn on me that it was the missing capital letter. Gotta comply with them Unix conventions...
Strangest of all, the laptop, on which rsync worked fine, was set to 'xinetd'. Yet, it worked... Go figure.

Well, all's well now.

I've learnt quite a bit by sorting this out.


Thank you, Billy, for the ideas and the listening.

jackn
 
Old 08-03-2007, 02:27 AM   #7
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,288

Rep: Reputation: 174Reputation: 174
no problem!
that's what we're all here for
 
Old 08-14-2007, 12:20 PM   #8
hroit
Member
 
Registered: May 2006
Posts: 31

Original Poster
Rep: Reputation: 15
Update, and, hopefully setting things straight

First off, I now have rsync regulary working in both directions without fail.

As to my previous posts in this thread, I was wrong, I don't know why, but the RSYNC_ENABLE variable should be set to 'true' and not 'True'. I'm sorry about that.

More importantly, my problems with rsync working only unidirectionally kept popping up, and I had no idea why.

One clue was that two other protocols I was using, namely nfs and ssh also worked only intermittently. Just like rsync, and in unison with it, they would either work both ways or, erratically, only unidirectionally.

Furthermore, while the three protocols above only worked intermittently, I could always ping either machine all the time, and I could always surf the net. Again, I emphasize, pinging was on all the time and so was internet access, whereas the three protocols worked intermittently.

Since I thought pinging and internet access meant a working network, I did not think I had a networking problem.

One day, however, for another reason, I followed advice on how to have Network Manager run the network. Basically, I had to stop NM, restart /etc/init.d/networking, and restart NM.

Ever since then, everything works all the time.

I think this shows it was a networking problem, but I don't know enough to figure out what could stop protocols, but not net access or pinging.

It's a 'solution' without understanding, but I'm happy to have things working, and others may understand better what's going on here.

Thanks for the help and attention.

jackn
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switch keyboard layout (works only one direction) krisyok Linux - Newbie 4 05-02-2007 06:12 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
XAWTV works, videodog works, motion works but how to code my own? rylan76 Linux - Hardware 0 01-06-2006 06:30 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Samba - works in one direction sdlsatcom Linux - Networking 0 01-25-2004 04:07 PM


All times are GMT -5. The time now is 07:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration