FAQ
If I'm running a command through the ssh library, ie, session.Run("sleep
1000"), how can I time it out?

Things I've tried:
-sending the ssh session a SIGTERM from another goroutine
-calling session.Close() from another goroutine (this seemed error prone,
but I was desperate)


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • James Bardin at Oct 26, 2013 at 2:55 am
    Because if the limited signaling you can do over ssh, I think the only way
    to cancel a command that isn't run through a pty is to close the connection
    altogether. This will kill the sshd child process, and hopefully the
    blocking process responds to the SIGHUP.


    On Friday, October 25, 2013 8:12:17 PM UTC-4, charlie...@overclocked.net
    wrote:
    If I'm running a command through the ssh library, ie, session.Run("sleep
    1000"), how can I time it out?

    Things I've tried:
    -sending the ssh session a SIGTERM from another goroutine
    -calling session.Close() from another goroutine (this seemed error prone,
    but I was desperate)

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Keith Rarick at Oct 27, 2013 at 12:05 am
    In one of our projects at Heroku, we've worked around this by
    setting deadlines or timeouts on the underlying TCP connection,
    though as noted above this unfortunately kills the entire ssh
    connection.

    I think it would be nice if ssh.Session had SetTimeout and/or
    SetDeadline methods that apply to the individual session.
    On Fri, Oct 25, 2013 at 7:55 PM, James Bardin wrote:
    Because if the limited signaling you can do over ssh, I think the only way
    to cancel a command that isn't run through a pty is to close the connection
    altogether. This will kill the sshd child process, and hopefully the
    blocking process responds to the SIGHUP.


    On Friday, October 25, 2013 8:12:17 PM UTC-4, charlie...@overclocked.net
    wrote:
    If I'm running a command through the ssh library, ie, session.Run("sleep
    1000"), how can I time it out?

    Things I've tried:
    -sending the ssh session a SIGTERM from another goroutine
    -calling session.Close() from another goroutine (this seemed error prone,
    but I was desperate)
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 26, '13 at 1:27a
activeOct 27, '13 at 12:05a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase