Timing out a channel exec request

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Is anyone aware of a method to force termination of a single channel
without waiting for the associated process to complete?

I have a use case where my client submits several commands to be executed
over the same session at the same time on separate channels.

In some cases (cough df), one or more those commands may hang indefinitely.

I detect that the command is not finishing in a reasonable amount of time,
and now I want to tear down that process. What do I do?

 - SSH2_MSG_CHANNEL_CLOSE results in a long polling loop where sshd keeps
trying to garbage collect the channel, but can't because the process is
still alive. Furthermore, this appears to be stalling the other commands
as well. (More experimentation is needed on this point.)
 - SSH_MSG_DISCONNECT tears down the whole session, killing *all* the
commands. I could do this, but now I have to restart all the other
commands that get trashed.
 - I could try a SSH_MSG_CHANNEL_REQUEST "signal" and send SIGINT,
SIGTERM, SIGABRT, etc, but I don't see a handler for "signal" in the
server loop.

I've crawled the source for a few hours, but haven't come up with any
ideas more productive than the non-options above.

I could use a clue or two as to other options / how others deal with
channel timeouts.

Thanks!
    - Tim.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux