in reply to Net::OpenSSH and tail -f

OpenSSH support for signaling remote processes is rather limited and so goes for Net::OpenSSH.

The only way I know to get OpenSSH to kill the remote process when the local one is terminated is requesting a tty:

my ($in, $out, $pid) = $ssh->open2({tty => 1}, "tail -f /foo/bar"); ... kill TERM => $pid; waitpid $pid, 0; close $in; close $out;
That may generate a harmless warning from OpenSSH ssh that you can ignore.

Replies are listed 'Best First'.
Re^2: Net::OpenSSH and tail -f
by farfabet (Initiate) on Feb 27, 2012 at 13:51 UTC
    Thanks salva, it works like a charm.