[systemd-devel] failing unmounts during reboot

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Thu Jul 25 12:02:57 UTC 2019


Lennart Poettering wrote:

> When generating native unit files from legacy sysv scripts, we use
> KillMode=process, which means we'll only kill the main process, and
> nothing else. This choice was made since its behaviour comes closest
> to classic SysV behaviour (since there the init system didn't kill any
> auxiliary processes either).
> 
> Given it's 2019 it might be wise to just write a native unit file if
> you want better control of this. Note that for native unit files we
> use different defaults: there we kill everything by default.
> 
> You can also reuse the generated unit, but only change the KillMode=
> setting, by creating a drop-in in
> /etc/systemd/system/<myservice>.service.d/<something>.conf, and then
> adding there:
> 
>      [Service]
>      KillMode=control-group

Yes, Mantas answer brought me to the same solution. For me that's
everything I need to solve the problems with our init.d scripts I guess,
so thanks!

> But let me underline: a SysV script which leaves processes around is
> simply buggy. In sysv it was expected that scripts would clean up
> properly on "stop", on their own. If you don't do that in your script,
> then maybe fix that...
>> The only correct way to shut things down is with individual ordering
> between units really, but that falls apart if you stick to historic
> sysv semantics too much.

Totally agreed, but the problem are scripts like the ones for grid or
matlab that have 200 lines or do such weird things that you couldn't
do anything but write a unit more or less like the one systemd-sysv-generator
creates. I just have to deal with those, but the KillMode drop-in
does help enough.

Thanks for all the explanations!

cu,
Frank
-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *


More information about the systemd-devel mailing list