in reply to Net::OpenSSH cmd not timing out as requested

I'm guessing that 'timeout' is really about giving up if the connection cannot be established. You'll need to add functionality to watch for your process taking too long. Two ways to do this that jump to mind are calling alarm or forking a child. I think perlipc should be helpful.

  • Comment on Re: Net::OpenSSH cmd not timing out as requested

Replies are listed 'Best First'.
Re^2: Net::OpenSSH cmd not timing out as requested
by Only1KW (Sexton) on Aug 11, 2010 at 22:20 UTC

    Well, there's a 'timeout' parameter associated with both the new and capture2 methods, so my guess was that the first timeout dealt with establishing the connection and the second dealt with running the command.

    Alarm looks like it should work for me. I will give it a try. I didn't want to fork as I don't think having a bunch of zombie processes in existance would be much better. And if I first waited for the forked process to complete, then I wouldn't be any better off than I am now.