in reply to Perl - running remote script doesn't return back the control to perl.

A shell trick from Net::SSH2 might help. This will start execution, then detach completely and allow the SSH2 connection to close. Possibly the syntax for the exec of the shell command can be used in the modules you are using to completely detach, or used in Cron.
#!/usr/bin/perl use Net::SSH2; # logon and object setup code omitted for clarity my $chan = $ssh2->channel(); $chan->blocking(1); $chan->exec("nohup /home/zentara/perlplay/net/zzsleep > foo.out 2> foo +.err < /dev/null &"); $chan->send_eof; exit;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Perl - running remote script doesn't return back the control to perl.
  • Download Code

Replies are listed 'Best First'.
Re^2: Perl - running remote script doesn't return back the control to perl.
by bshah (Novice) on Mar 21, 2014 at 16:57 UTC

    Thank you all for the great suggestion. I'll try it.