[systemd-devel] Allow stop jobs to be killed during shutdown

Lennart Poettering lennart at poettering.net
Thu Feb 6 02:03:12 CET 2014


On Thu, 06.02.14 01:35, Djalal Harouni (tixxdz at opendz.org) wrote:

> session_start()
>   => session_start_scope()
>      => manager_start_scope() will fail
> 
> The pam_systemd will not register the session, and logind function
> results will be wrong...
> 
> 
> Anyway it seems that this also got fixed, is this the correct fix!
> did not have time to debug, but after a "git pull" I did a quick 
> test using bash signal trap, got the correct SIGTERM+SIGHUP but
> still we do not wait for session processes...

I'll have a closer look into the GC and killing logic for sessions.

> Lennart please, another thing:
> 
> src/core/unit.c:unit_kill_context() in the KILL_CONTROL_GROUP or
> KILL_MIXED test:
> 
> "sig" can be SIGKILL or during the next call after the first
> SIGTERM + SIGHUP , sig for sure will be SIGKILL so we have
> cg_kill_recursive() sending a SIGKILL, what if it returns > 0
> we'll endup sending another SIGHUP after the SIGKILL...
> 
> Not sure, I'll try to test it tomorrow.

A true! I now conditionalized the SIGHUP to be only send when "sigkill"
is true. (Not that we don't check if sig == SIGKILL, but really check
for the boolean passed. Sending the SIGHUP after sig == SIGKILL makes
little sense, but there are quie a number of other combinations that
make little sense either and we don't check for them either, for example
setting SendSIGHUP to enabled, but also setting KillSignal=SIGHUP... I
don't think we should try too hard to check for these non-sensical
combinations, since they won't hurt much... That said sending the SIGHUP
after the final SIGKILL is certainly bogus indeed, so I fixed that...)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list