Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > problems with ssh
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 14th October 15:02
martin.bowes
External User
 
Posts: 1
Default problems with ssh



Hi Everyone,

A little off topic but,....

I have a job which automates the transfer of journals checkpoints etc
from one host to another as part of my Disaster Plans.

It relies on ssh between the hosts involved.

So I've setup ssh and it works perfectly - interactively. And in most
cases it will work perfectly well in batch mode between most hosts. But
every now and then the process stalls in the batch mode. That is, the
command seems to have functioned - but just wont terminate and
leaves a process hanging around.

I've tried wrapping the command in 'markers' to try and force output and
hopefully close the channel. I've put in place Perl sig alarm processing
but it just won't stop the process.

A typical command would read
/usr/bin/ssh -x -T a_host 'echo "";infodb my_database;echo
"SSHone"' 2>&1 </dev/null

Any ideas?

Martin Bowes
--
Random Duckman Quote #97:
Duckman: You got anymore of those glues?
Cornfed: Clues.
Duckman: I'm one letter off, crucify me!
  Reply With Quote


 


2 14th October 15:10
jürgen_cappel
External User
 
Posts: 1
Default problems with ssh



Hi Martin,

just a quick thought, is there anything unusual in your .bashrc
that might cause this ? On my linux box it is executed.

HTH,

Jürgen

-------- Original Message --------
Subject: [Info-ingres] problems with ssh
Date: Tue, 21 Nov 2006 12:00:13 -0000
From: martin.bowes@ctsu.ox.ac.uk
To: info-ingres@cariboulake.com

Hi Everyone,

A little off topic but,....

I have a job which automates the transfer of journals checkpoints etc
from one host to another as part of my Disaster Plans.

It relies on ssh between the hosts involved.

So I've setup ssh and it works perfectly - interactively. And in most
cases it will work perfectly well in batch mode between most hosts. But
every now and then the process stalls in the batch mode. That is, the
command seems to have functioned - but just wont terminate and
leaves a process hanging around.

I've tried wrapping the command in 'markers' to try and force output and
hopefully close the channel. I've put in place Perl sig alarm processing
but it just won't stop the process.

A typical command would read
/usr/bin/ssh -x -T a_host 'echo "";infodb my_database;echo
"SSHone"' 2>&1 </dev/null

Any ideas?

Martin Bowes
--
Random Duckman Quote #97:
Duckman: You got anymore of those glues?
Cornfed: Clues.
Duckman: I'm one letter off, crucify me!

_______________________________________________
Info-ingres mailing list
Info-ingres@cariboulake.com
http://mailman.cariboulake.com/mailm...py/info-ingres
  Reply With Quote
3 14th October 15:10
martin.bowes
External User
 
Posts: 1
Default problems with ssh


Hi Jürgen,

..bashrc? Uuugh! I'm a tcsh man myself!

But rather than start a holy war...

In either case, if there was a problem in the .cshrc, .login, .bashrc
..whatever, I would have thought this would effect all connections and
not just some of the batch jobs. Furthemore, The cases I've seen
where this is a problem in these scripts the ssh process will exit with an
error, not hang.

Thanks anyway, keep the suggestions coming, coz' I've exhausted all
my ideas.

Marty
  Reply With Quote
4 14th October 15:10
karl & betty schendel
External User
 
Posts: 1
Default problems with ssh


A bit of a long shot since you're not running anything
backgrounded, but ... maybe try adding -n to the ssh command.

Karl
  Reply With Quote
5 14th October 15:10
frederick myers
External User
 
Posts: 1
Default problems with ssh


Marty

I think you'll find that there is a utility called scp
that uses the ssh protocol to copy files between machines...

Good luck

Fred


--
_-_|\ Frederick W. Myers fred@dsdata.com.au
/ \ 187 Mondurup St Mt Barker WA 6324 Australia
\*.-._/
v http://www.dsdata.com.au
  Reply With Quote
6 14th October 15:11
martin.bowes
External User
 
Posts: 1
Default problems with ssh


Hi Fred,


Yes, I use it extensively.

But I still need the ssh to kick off the infodb and that is stalling.

Marty
  Reply With Quote
7 14th October 15:11
michael leo
External User
 
Posts: 1
Default problems with ssh


Martin,

Is the server extremely loaded? Are the MANY ssh
commands starting at once. We have seen problems with this on Solaris
machines.

I've also searched the FAQ ... found some food for thought:

http://www.openssh.org/faq.html#3.10

http://www.openssh.org/faq.html#3.11

Two things to try:

1) Add the -vvv flag and don't redirect stderr to stdout. Instead
let your program use stdout, as usual, and append stderr to some file:

echo "*** Calling SSH at $(/bin/date) ***" >>/tmp/sshdebug.log

/usr/bin/ssh -vvv -x -T a_host 'echo "";infodb my_database;echo
"SSHone"' 2>>/tmp/sshdebug.log </dev/null

echo "*** Finished calling SSH at $(/bin/date) ***" >>/tmp/sshdebug.log

2) Check the SSHD log on the server for errors.


3) Try to run pretty modern versions (4.2 or above) on both
the client and server. Standard Linux distros are shipped with
ancient version of SSH, unfortunately.

Cheers,

Mike Leo

P.S. I'm a recovering tsch-er myself. Unify your life ... bash.
  Reply With Quote
8 14th October 15:11
paul white
External User
 
Posts: 1
Default problems with ssh


Hi Marty,
Have you checked to see if you already have infodb running?
We experienced installation hangs when running infodb | other_commands |
more
It locked up infodb, checkpoints and other installation level commands
until the more command was completed.

Paul

-----Original Message-----
From: info-ingres-admin@cariboulake.com
[mailto:info-ingres-admin@cariboulake.com] On Behalf Of Michael Leo
Sent: Wednesday, 22 November 2006 1:39 AM
To: martin.bowes@ctsu.ox.ac.uk
Cc: info-ingres@cariboulake.com
Subject: Re: [Info-ingres] problems with ssh

Martin,

Is the server extremely loaded? Are the MANY ssh commands starting at
once. We have seen problems with this on Solaris machines.

I've also searched the FAQ ... found some food for thought:

http://www.openssh.org/faq.html#3.10

http://www.openssh.org/faq.html#3.11

Two things to try:

1) Add the -vvv flag and don't redirect stderr to stdout. Instead
let your program use stdout, as usual, and append stderr to some
file:

echo "*** Calling SSH at $(/bin/date) ***" >>/tmp/sshdebug.log

/usr/bin/ssh -vvv -x -T a_host 'echo "";infodb my_database;echo
"SSHone"' 2>>/tmp/sshdebug.log </dev/null

echo "*** Finished calling SSH at $(/bin/date) ***"


2) Check the SSHD log on the server for errors.


3) Try to run pretty modern versions (4.2 or above) on both
the client and server. Standard Linux distros are shipped with
ancient version of SSH, unfortunately.

Cheers,

Mike Leo

P.S. I'm a recovering tsch-er myself. Unify your life ... bash.


_______________________________________________
Info-ingres mailing list
Info-ingres@cariboulake.com
http://mailman.cariboulake.com/mailm...py/info-ingres
  Reply With Quote
9 18th October 03:57
martin.bowes
External User
 
Posts: 1
Default problems with ssh


Hi Paul,

In this case I'm pretty sure this would be the only infodb running at the
time. Furthermore, the Ingres installation is perfectly okay. It simply
looks more like some OS issue in that the command executes but
refuses to disconnect from the SSH server.

Marty
  Reply With Quote


 


10 18th October 04:04
martin.bowes
External User
 
Posts: 1
Default problems with ssh


Hi Mike,


When the stall occurs, a ps shows only a single ssh command being
executed on the host.


Thanks heaps, I'll look into those.


client> ssh -V
OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090600f

server> ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8a 11 Oct 2005

Like the mighty Hermit Crab, I'll carry my shell with me!


Marty.

PS. Whats the story with CaribouLake and KettleRiver?
  Reply With Quote
Reply


Thread Tools
Display Modes




666