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

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Thu Jul 2 03:24:18 PDT 2015


Hi,

for our diskless clients I setup the network and the root fs in the 
kernel/initrd and do two additional mounts in the initrd which are
specific for every client.

I understand the boot concept with its dependencies and ordering but I've 
no idea how to influence the shutdown process in two ways:

1. I want to keep the network running. To avoid problems with dependencies
   I had to keep it enabled although all the stuff is done in the kernel/initrd.
   Thus, it shuts down during reboot and the diskless client hangs of course.

   Changing the ExecStop to /usr/bin/true does work, but I wonder if there
   is a better way in general to remove a process from the shutdown tree.
   In SysV I just did "inserv -r network" in halt.local so that the shutdown
   link was removed before it would be considered.
   
   Is there something similar for systemd? "systemctl disable network"
   didn't work.

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.

  Is there a way to exclude certain (NFS) mounts from the umount target
  (or from sth. else?) during shutting? No matter if they have a *.mount
  in /run/ or not?

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