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

Colin Guthrie gmane at colin.guthr.ie
Mon Jan 27 03:27:31 PST 2014


'Twas brillig, and Andrey Borzenkov at 26/01/14 17:16 did gyre and gimble:
>> > I guess what we want is to first send SIGTERM only to the systemd
>> > --user process, and only after a timeout start sending SIGTERM to all
>> > the processes in the control group? I.e., wouldn't a ExecStop entry in
>> > user at .service give us the required timeout?
>> > 
> Does not work. systemd sends SIGTERM as soon as ExecStop finished.

Could you not use the same hack that apache httpd needs?

http://pkgs.fedoraproject.org/cgit/httpd.git/tree/httpd.service#n28

> ExecStop=/bin/kill -WINCH ${MAINPID}
> # We want systemd to give httpd some time to finish gracefully, but still want
> # it to kill httpd after TimeoutStopSec if something went wrong during the
> # graceful stop. Normally, Systemd sends SIGTERM signal right after the
> # ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
> # httpd time to finish.
> KillSignal=SIGCONT


It's probably not "nice" to do that, but it should give the necessary
time to let things clean up properly...

A proper fix is probably highly desirable tho'!

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list