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

Andrei Borzenkov arvidjaar at gmail.com
Fri Jul 3 07:22:47 PDT 2015


On Fri, Jul 3, 2015 at 5:03 PM, Frank Steiner
<fsteiner-mail1 at bio.ifi.lmu.de> wrote:
> Lennart Poettering wrote
>
>> Normally the network mounts should be ordered after network.target,
>> and wicked before that. Since in systemd the shutdown order is always
>> the inverse of the startup order this would mean that the mounts are
>> removed first, and wicked only stopped afterwards.
>
> I guess the problem is the root-over-nfs. On reboot I can see all
> the NFS mounts are unmounted, but not / (which is good :-)). Then wicked
> stops. It seems the system is not aware of the root fs the way it
> gets mounted over nfs(v4) in dracut. I can't find any matching .mount
> in /run/systemd or in "systemctl list-dependencies".
>

This would not fit systemd dependency chain anyway. All standard
services are stopped on shutdown. As long as all existing interfaces
are represented by a single running service (wickedd) it is
responsibility of this service to avoid interface shutdown in such
case. Note that 13.1 tried to use different model where each interface
had own service. That would allow to easily exempt root filesystem
interface from shutting down by dropping in DefaultDependency=no.

Alternative is to always use DefaultDependency=no to keep wikcedd from
being stopped on shutdown.

>> How is that "certaint point" defined? As something like "after service
>> foo has been shut down"? If so, then my recommendation above of adding
>> RequiresMountsFor= to the service sound like the much better solution.
>
> Sounds semantically better! I'll try that!
>
> 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. *
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list