in reply to Net::OpenSSH - Long running remote perl script doesnt bring back the control

Maybe, because just like Net::SSH::Perl ( Re^3: Net::SSH::Perl doesn't like long commands ) it's not protected from EINTR etc
  • Comment on Re: Net::OpenSSH - Long running remote perl script doesnt bring back the control

Replies are listed 'Best First'.
Re^2: Net::OpenSSH - Long running remote perl script doesnt bring back the control
by sudhakar.betha (Initiate) on Jul 12, 2013 at 22:58 UTC

    Got this working now.Thanks first of all for replying. This was my first post here !!!

    The problem was in using 'fork' inside the remote perl that was getting executed. Earlier I fork'ed the process in the remote perl and left them in the same shell. This time, I fork'ed the process and ran them as background processes.

    $pid = fork(); if ( $pid == 0 ) {system("$cmd &") || warn ("Could not exec $cmd.\n"); + exit 0;}