Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Strange behaviour with SSH command launched with open

by RichardK (Priest)
on Jun 04, 2014 at 09:59 UTC ( #1088604=note: print w/ replies, xml ) Need Help??


in reply to Strange behaviour with SSH command launched with open

If you have a look at the help for system it says :-

         If you'd like to manually inspect "system"'s failure, you can
            check all possible failure modes by inspecting $? like this:

                if ($? == -1) {
                    print "failed to execute: $!\n";
                }
                elsif ($? & 127) {
                    printf "child died with signal %d, %s coredump\n",
                        ($? & 127),  ($? & 128) ? 'with' : 'without';
                }
                else {
                    printf "child exited with value %d\n", $? >> 8;
                }

Which will give you 'child exited with value 255', so ssh failed returning -1, therefore check your ssh setup.


Comment on Re: Strange behaviour with SSH command launched with open
Re^2: Strange behaviour with SSH command launched with open
by smutel (Initiate) on Jun 04, 2014 at 10:54 UTC
    Thanks for your help. Another question: how can I display error message returning by the ssh command with open command. I tried 2>&1 but it seems to not work correctly. Regards, Samuel Mutel.

      I'm not sure, but IPC::Open3 might give you better results.

Re^2: Strange behaviour with SSH command launched with open
by smutel (Initiate) on Jun 04, 2014 at 13:02 UTC

    It's not exactly a question about perl :

    - Do you know if SSHD limit the number of concurrent process ?

    - Same question with open ?

    Regards,

    Samuel Mutel.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-12-27 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls