Rather strange problem copying, need assistance.

Reply

Join Date: Aug 2006
Posts: 999
Reputation: EnderX is an unknown quantity at this point 
Solved Threads: 1
EnderX EnderX is offline Offline
Posting Shark

Rather strange problem copying, need assistance.

 
0
  #1
Oct 10th, 2006
Earlier in the day, I was forced to generate a new public key/private key pair for one of the systems I work with, as it appeared to have been hacked into at some point during the night. The system in question was running a process called 'Slony', which is used for database replication. After building the new key and adding the public keys for the other systems that slony's replication fed, I noticed a rather strange problem.

In addition to the main database, the server that got hacked runs a second archival db, which is supposed to be replicated to and updated alongside the remote systems. When I created the new keys, the replication to the system stopped working. I had originally included a passphrase, and the perl files which ran the replication as a cron job were throwing errors about bad passwords. I decided to rebuild the key again, this time leaving the space blank. That is, I just hit 'Enter' when the system requested a passphrase. It requested the same phrase be repeated, though, and that may be the core of my problem...I may not have gotten rid of the passphrase.

Anyway, when I try to run the system now, it tries to scp the replication files, but the scp times out. As far as I can tell, the timeout is getting called from this segment of code, which comes from a system-installed file called Expect.pm:
  1. unless($scp->expect($timeout,-re=>'[Pp]assword.*?:|[Pp]assphrase.*?:')){
  2. my $err=$scp->before() || $scp->match();
  3. if($err){
  4. if($handler){$handler->($err) }
  5. croak("Problem performing scp: $err");
  6. }
  7. croak("scp timed out while trying to connect to $host");
  8. }
I'm getting the 'scp timed out while trying to connect' error message, but not the other one. Anybody have any clue why this is, or what might be done to solve the problem? I was able to force replication today by manually copying the files and removing the call to scp from the cron script, but I'd rather not have to do that; it's an hourly job and can't really afford to get too backed up.

Thanks in advance,
-EnderX
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Rather strange problem copying, need assistance.

 
0
  #2
Oct 10th, 2006
whats the value of $timeout?

unless($scp->expect($timeout,-re=>'[Pp]assword.*?[Pp]assphrase.*?:')){
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,281
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 243
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Rather strange problem copying, need assistance.

 
0
  #3
Oct 11th, 2006
You said you removed the passphrase, but here you are waiting for the passphrase prompt. Of course it will timeout as this should never come.

You should be able to comment out this block of code and the line or lines where you send the password and continue with the next expect pattern.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Perl Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC