[systemd-devel] [PATCH] tty-ask-password-agent: reset a signal handler for SIGTERM to the default

Lennart Poettering lennart at poettering.net
Tue Aug 26 12:17:10 PDT 2014

On Mon, 25.08.14 12:32, HATAYAMA Daisuke (d.hatayama at jp.fujitsu.com) wrote:

> Hello,


> When trapping SIGTERM in a script and running systemctl from the
> script, systemctl sometimes hangs with tty-ask-password agent process.

Hmm, so in general, if people invoke our tools with weird signal masks
I'd blame it on them, we shouldn't have to reset the signal masks in all
our tools all the time... I mean, of course, if SIGTERM then doesn't
work on the process, we can just blame the process that invoked us...

However in this case, where we fork off the agent process on our own,
and rely on sending SIGTERM to it, and actually work I think it's our
duty to fix things up, so that we don't leave processes around...

> I have no idea whether systemd developpers think this is a bug or
> not. If this is a bug, I have three ideas to fix this. This patch is
> based on the 1).
> 1) Reset a signal handler for SIGTERM to the default before spawning
>    an agent process from systemctl.

Sounds like the right option here... I have now added a slightly
different patch (1dedb74a2e1d840b531b76b01a76979f3b57456b) that does



Lennart Poettering, Red Hat

More information about the systemd-devel mailing list