[systemd-devel] How to keep certain services or mounts active during shutdown?

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Thu Jul 2 05:45:19 PDT 2015


Mantas Mikulėnas wrote

 > If the 'main' network.service doesn't do anything anyway (since the
> network is already up), you can replace it entirely with Type=oneshot,
> ExecStart=/bin/true, RemainAfterExit=yes, essentially a service that
> does nothing at all (but still satisfies dependencies).

Ok, I'm fine doing it this way! Just thought there might be a better
way.

>     2. The two additional NFS mounts should be kept active, too. There
>     are no
>       *.mount files for them in /run/systemd/generator, because they are
>       mounted in the initrd I guess.
> 
> 
> Not sure about this one. I wonder if the "shutdown initramfs" feature
> [1] would help here.

I didn't see how that might help. I'll try to setup *.mount file
for these mounts and try to order them with Before/After directivies
so that they are kept as long as possible during the shutdown.

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