I see at least one other has had issues with xinetd. It also exhibits the same condition for me from cron, from an at job, even from a script that I've nohup'd and then logged out of the session. Apparently a controlling vty is needed.

The code segment itself looks like this:

if( $options{protocol} eq 'ssh' ) { unless( defined $options{userid} ) { die "userid is a required parameter when using ssh\n"; } if( $options{login} and not defined $options{passwd} ) { die "passwd is a required parameter for ssh if login is true\n"; } @args = ( '/usr/bin/' . $options{protocol}, '-l', $options{userid} +, '-p', $options{port}, '-q', '-o','StrictHostKeyChecking=no',$option +s{target} ); } elsif( $options{protocol} eq 'telnet' ) { @args = ( '/usr/bin/' . $options{protocol}, $options{target}, $opt +ions{port} ); if( $options{login} ) { unless( defined $options{userid} and defined $options{passwd} ) +{ die "userid and passwd are both required parameters for telnet + if login is true\n"; } } } else { die "Unknown protocol specified: $options{protocol}\n"; } if( $options{logging} ) { unless( defined $options{logfile} ) { $options{logfile} = "$options{target}.log"; } open( $options{fh}, ">", $options{logfile} ) || die "Can't open fi +le $options{logfile}: $!\n"; } # ==================================================================== +========= # Spawn the child process to contact the target device # ==================================================================== +========= $options{pty} = IO::Pty::Easy->new; $options{pty}->spawn(@args) or die "Unable to spawn child process: $ +!\n";

at which point I unuversally get the "Unable to spawn child process" with no error number.

And yes, it works fine if I fire off the script from an interactive shell. That is the only way it does work.

What am I missing? I can't believe anything in Perl would REQUIRE an interactive shell.

(Oh and its running on CentOS 6.3 - so Linux not Windows)

Please advise.


In reply to IO::Pty::Easy from a non-interactive shell by dfdumont

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.