[freeside] Net::SSH and File::Rsync issues

Rick Harby rharby at caarnet.com
Tue Jul 15 14:11:47 PDT 2003


I've setup ssh correctly, like I said, either of the commands in the
script works just fine if it's the ONLY command in the script, it's when
an rsync is done before the ssh that I have a problem. I have also
tested by manually ssh'ing form the freeside user to the root account,
no problem at all.
 
Rick
 
-----Original Message-----
From: Randall Lucas [mailto:rlucas at tercent.net] 
Sent: Tuesday, July 15, 2003 5:01 PM
To: ivan-freeside at sisd.com
Subject: Re: [freeside] Net::SSH and File::Rsync issues
 
Hi Rick,

Have you checked to see that the SSH shell (or otherwise) isn't entering
interactive mode and waiting for a pw and/or a "I don't recognize this
host's signature" dialog? Note that if you test out the ssh connection
as one user, and run this program as another user (e.g. uid freeside),
you may not catch the problem. Try manually testing out your rsync and
ssh as the user under which you're running this code.

R

On Tuesday, July 15, 2003, at 04:04 PM, Rick Harby wrote:
Ivan,

 Any chance you could help me out on this one, I have Freeside installed
on a Linux Redhat 9 box, seems to work just fine, but the exports seem
to have problems. So I started looking into it, and it seems that ssh
hangs or goes defunct somehow. I wrote a test script below as follow
(well actually just took code out of an export for it):

 

#!/usr/bin/perl

 

useFile::Rsync;

useNet::SSH qw(ssh);

 

$DEBUG = 1;

$prefix =
"/usr/local/etc/freeside/export.DBI\:Pg\:dbname\=freeside/bind/localhost
";

 

my$rsync = File::Rsync->new({

 rsh    => 'ssh',

});

 

$rsync->exec( (

       src    => "$prefix/",

       recursive      => 1,

       dest           => "root\@localhost:/var/named",

       exclude        => [qw( *.import named.conf.HEADER named.conf )],

       ) ) or die "rsync to localhost failed: ". join(" / ",
$rsync->err);

 

ssh("root\@localhost", 'echo done >/tmp/done');

 

 

 This script just HANGS, but the interesting part is if I comment out
the rsync->exec command, the ssh command runs fine, OR if I comment out
the ssh command the rsync code works fine. If they are both in the
script, the rsync seems to run, but the ssh gets hung and looks like
this in the process list:

 

freeside25635 0.0 0.0    0   0 pts/0   Z   16:03  0:00 [ssh <defunct>]

freeside25636 0.7 0.3 3468 1684 pts/0   S   16:03  0:00 ssh -T -o
BatchMode yes root at localhost echo done >/tmp/done

 

  ANY IDEAS? Thanks a lot.

 

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://420.am/pipermail/freeside-users/attachments/20030715/4107920a/attachment.html


More information about the freeside-users mailing list