cosmicperl has asked for the wisdom of the Perl Monks concerning the following question:
Ran from command prompt this works great (returns 1-2-3-4-Output, etc...). Ran in browser is drops out (returns 1-2-3-). Apache is set to use SuEXEC so the script is executed as user "cosmic", so I changed to user cosmic from the command prompt and tried it and it still worked. So it appears that it only will not work when ran through browser... I have no idea why, and I'm getting no errors, even with the debug option set. When using top to monitor the process, from the command prompt it takes about 24 seconds to connect, and it the browser it stops after only 12 seconds. I know apache is set to let the process run for 300 seconds so it's not killing the process (or at least shouldn't be).print "Content-type: text/html\n\n"; print "1-"; use Net::SSH::Perl; print "2-"; my $ssh = Net::SSH::Perl->new($Config->{ssh}->{host}, {protocol => 2, +debug => true}); print "3-"; $ssh->login($Config->{ssh}->{user}, $Config->{ssh}->{pass}); print "4-"; my ($stdout, $stderr, $exit) = $ssh->cmd("ls"); print "Output:- $stdout, $stderr, $exit";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH:Perl problems when ran as CGI
by MidLifeXis (Monsignor) on Aug 30, 2007 at 18:23 UTC | |
|
Re: Net::SSH:Perl problems when ran as CGI
by runrig (Abbot) on Aug 30, 2007 at 18:36 UTC | |
by Anonymous Monk on Aug 30, 2007 at 22:34 UTC | |
|
Re: Net::SSH:Perl problems when ran as CGI
by runrig (Abbot) on Aug 30, 2007 at 18:52 UTC | |
|
Re: Net::SSH:Perl problems when ran as CGI
by juanmatias (Initiate) on Sep 07, 2007 at 15:17 UTC | |
by Anonymous Monk on Dec 10, 2007 at 16:20 UTC | |
|
Re: Net::SSH:Perl problems when ran as CGI
by jiraf (Initiate) on Sep 06, 2007 at 19:04 UTC |