Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Net::OpenSSH in a mod_perl handler

by salva (Canon)
on Mar 24, 2010 at 15:26 UTC ( [id://830597]=note: print w/replies, xml ) Need Help??


in reply to Net::OpenSSH in a mod_perl handler

Could you try using /dev/null as the default STDIN?
open my $stdin_fh, '<', '/dev/null' or die "unable to open /dev/null"; my $ssh = Net::OpenSSH->new(SSH_HOST, default_stdin_fh => $stdin_fh, ... ); ...

mod_perl is probably tie'ing STDIN to something that does not have a real file handle behind.

update: besides that, it seems that there are some issue with capture not capturing anything... I am investigating it!

Replies are listed 'Best First'.
Re^2: Net::OpenSSH in a mod_perl handler
by eserte (Deacon) on Mar 24, 2010 at 17:19 UTC
    This got me one step further: [Wed Mar 24 18:16:06 2010] [error] [client 127.0.0.1] child process STDOUT is not a real system file handle at /tmp/lib/test/openssh.pm line 40\n

    After setting the default_stdout_fh option using the same schema the $ssh->system command works, at least with mod_perl 2. $ssh->capture still does not work; there is no error, but also nothing is captured.

      The issue was related to STDIN and STDOUT not being attached to file descriptors 0 and 1 respectively under mod_perl.

      Can you try version 0.46_01 that I have just uploaded to CPAN?

        Excellent! This fixes the problem, at least with mod_perl 1 (mod_perl 2 not tested).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://830597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2026-05-11 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.