Skip to content

Channel signal send & receive support - #823

Closed
radssh wants to merge 4 commits into
paramiko:masterfrom
radssh:channel-signal
Closed

radssh wants to merge 4 commits into
paramiko:masterfrom
radssh:channel-signal

Conversation

@radssh

@radssh radssh commented Oct 3, 2016

Copy link
Copy Markdown
Contributor

For #785 - didn't notice the whitespace changes until just now, can amend PR if you want that tidied up. Feels a bit kludgey to have both exit_status and exit_signal which are mutually exclusive, but can't do too much without possibly breaking existing code.

radssh added 4 commits August 21, 2015 19:18
Handle `exit-signal` on client as alternative process termination to
`exit-status`. Allow client to send signal messages, even if OpenSSH
doesn’t currently propagate them to the running process.
Add stub on server.py for receiving signal messages from client.
@coveralls

coveralls commented Oct 3, 2016 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 74.039% when pulling d2736c2 on radssh:channel-signal into 7366f96 on paramiko:master.

@bitprophet bitprophet added this to the 2.1 milestone Oct 4, 2016
@bitprophet bitprophet added the Bug label Oct 4, 2016
@bitprophet

Copy link
Copy Markdown
Member

Quick thoughts re: the client side API here:

  • I didn't write any of the current "do a thing and then figure out if it worked" API, but as-is, it's predicated on a user holding a Channel and eventually calling recv_exit_status() (potentially polling exit_status_ready beforehand.)
    • While users can access the .exit_status attribute directly, it's not (as far as I can tell) commonly done.
    • .exit_status (or its value returned via recv_exit_status()) is, as far as I recall, never actually -1 in any normal scenario that doesn't involve an exception being raised. (It's the default, but the code paths are always "get real value from server, or handle exception".)
  • This PR, as it stands, turns the "deal with exit status" API into "call recv_exit_status as before, but check to see if it's -1, and if so, check .exit_signal."
  • So what I'm pondering is whether it makes sense to add more methods (perhaps something slightly higher level that wraps recv_exit_status + testing exit_status + testing exit_signal?) to keep things more consistent & method-oriented.
  • However, I don't want this to get tied up in red tape, so my instinct is to say we should merge as-is - with the attribute-setting being a foundation we can optionally build on later. But just curious as to your immediate thoughts.

@bitprophet bitprophet modified the milestones: 2.2, 2.4.0 Aug 16, 2017
@takluyver

Copy link
Copy Markdown

OpenSSH is gaining the ability to handle signals on the server side, with some restrictions. It looks like this will be ready in OpenSSH 7.8: https://bugzilla.mindrot.org/show_bug.cgi?id=1424

The set of signals it handles will be HUP, INT, KILL, QUIT, TERM, USR1 and USR2. This probably shouldn't be a limit on the client side - other servers might support more - but it might be worth documenting somewhere, in case people get confused that sending another signal fails. Of course, that set could also change in the future.

@bitprophet bitprophet modified the milestones: p0, p2 Oct 16, 2018
@ssbarnea

Copy link
Copy Markdown

Any change to update this branch?

@bra-fsn

bra-fsn commented Mar 4, 2019

Copy link
Copy Markdown

Any news on this one?

@rustyscottweber

Copy link
Copy Markdown

The signal sending for sshd have been supported for quite some time on the server side. However, this merge request has been pending for some 5 years now. Is there something that I can do to resolve the merge conflicts and get this change merged in?

@ssbarnea

Copy link
Copy Markdown

@rustyscottweber It is far from uncommon for the original OP to lose interest in updating a pull-request, especially after this long. What I succesfully did was to fix his change in my own fork and make another pull request. Once the new one is passing the cores can close the old one.

@rustyscottweber

Copy link
Copy Markdown

Thank you @ssbarnea, I wasn't sure if I should do exactly what you just did or if I should work from the existing merge request.

@rustyscottweber

Copy link
Copy Markdown

@ssbarnea , Is there merge request reference I can follow or help out with?

@MrMino

MrMino commented Feb 27, 2021

Copy link
Copy Markdown
Contributor

@ssbarnea FWIW I did similar PR in #1535, just with a lot tighter scope.

@bitprophet
bitprophet deleted the branch paramiko:master October 9, 2021 01:00
@bitprophet bitprophet closed this Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants