Bug 2719 - Notify user, when ssh transport process dies.
Summary: Notify user, when ssh transport process dies.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 7.5p1
Hardware: SPARC Solaris
: P5 minor
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_7_8
  Show dependency treegraph
 
Reported: 2017-05-22 23:15 AEST by Tomas Kuthan
Modified: 2021-04-23 15:02 AEST (History)
3 users (show)

See Also:


Attachments
Notify user, when ssh transport process dies (1.60 KB, patch)
2017-05-22 23:18 AEST, Tomas Kuthan
no flags Details | Diff
slightly tweaked (993 bytes, patch)
2017-06-30 13:39 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Kuthan 2017-05-22 23:15:49 AEST
When ssh transport process dies (e.g. if remote side hangs up), the user
does not learn about it,  until they try to execute the next remote
command.

The sftp process has this information available; it would be prudent to let the user know.
Comment 1 Tomas Kuthan 2017-05-22 23:18:41 AEST
Created attachment 2982 [details]
Notify user, when ssh transport process dies
Comment 2 Tomas Kuthan 2017-05-22 23:24:41 AEST
Alternatively, sftp process could just quit, when the underlying ssh process goes away. There is very little it can do anyway.
Comment 3 Tomas Kuthan 2017-05-22 23:26:02 AEST
If #2718 is implemented, this issue gets more visible.
Comment 4 Damien Miller 2017-06-23 13:45:45 AEST
I think the patch as it stands will break the '!' shell-out command. That's easy enough to fix local_do_shell() to reset the signal handler for it's business.

I wonder if there's some nicer way of informing though, but it seems tricky with libedit in the way...
Comment 5 Tomas Kuthan 2017-06-24 02:07:20 AEST
Hi Damien,

Thanks for looking at the patch.

I don't think it is harmful for '!' commands. The SIGCHLD handler doesn't do anything, if the departed child was not the transport ssh process. Reseting the handler would not be wrong, but I don't think it is necessary. 

Thanks,
Tomas
Comment 6 Damien Miller 2017-06-30 13:39:48 AEST
Created attachment 3002 [details]
slightly tweaked

A couple of small tweaks to the original diff:

Made it apply cleanly (your tree seems to have some additional signal() calls)

WNOWAIT doesn't seem to be POSIX and certainly isn't available on BSD

move a comment.
Comment 7 Damien Miller 2018-04-06 13:12:20 AEST
Move to OpenSSH 7.8 tracking bug
Comment 8 Damien Miller 2018-05-11 13:40:33 AEST
This was committed a few weeks back. It will be in the OpenSSH 7.8 release.
Comment 9 Damien Miller 2021-04-23 15:02:30 AEST
closing resolved bugs as of 8.6p1 release