* bug#21866: How to stop children of pty subprocesses from receiving a SIGHUP when main subprocess exits?
@ 2015-11-09 2:03 Noam Postavsky
0 siblings, 0 replies; only message in thread
From: Noam Postavsky @ 2015-11-09 2:03 UTC (permalink / raw)
To: 21866
While investigating a magit bug[1], we found that when a subprocess
with process-connection-type = pty ends, any subprocesses it has
spawned will receive a SIGHUP.
A simple way to see the problem is doing
git config --global credential.help='cache --timeout=3600'
And then doing a "git push" to a password protected https remote twice
from M-x eshell. You will be asked for your password both times. The
same from M-x shell only asks the first time (note that after a
successful push from a normal shell, you won't be asked for a password
in eshell either because it can pick up existing daemons, it's just
that it always kills its own daemons).
For a self contained example, using the attached files:
emacs -Q -l start-process-note-sighup.el
And notice that sighup.log contains "got sigup". Doing the same in
bash, a sighup is not sent if job control is on (the default for
interactive shells).
xterm -e 'bash -c "set -m ; ./call-note-sighup"' ; cat sighup.log #
no sigup, do pkill note-sighup after
xterm -e 'bash -c "set +m ; ./call-note-sighup"' ; cat sighup.log # sigup sent
We have a workaround for the git daemon situation, and I'm also
looking into possibly adding an option to git to ignore the sighup[2],
but I think it would make sense for Emacs to be able to avoid sending
sighup in this situation too. I poked around process.c a bit, but I
couldn't figure out where this signal gets sent from.
[1]: https://github.com/magit/magit/issues/2309
[2]: http://www.mail-archive.com/git%40vger.kernel.org/msg79211.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-09 2:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-09 2:03 bug#21866: How to stop children of pty subprocesses from receiving a SIGHUP when main subprocess exits? Noam Postavsky
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.