]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(network-manager): nm-run.service: don't kill forked processes
authorDusty Mabe <dusty@dustymabe.com>
Wed, 14 Apr 2021 14:46:12 +0000 (10:46 -0400)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 15 Apr 2021 11:07:07 +0000 (13:07 +0200)
If teaming is set up via NetworkManager we don't want systemd to take
down the userspace teamd process when NetworkManager quits. `KillMode=process`
will allow it to leave those processes behind.

This is fallout from the change to run NetworkManager via systemd (c17c5b7).

With `KillMode=process` we get something like:

```
sh-5.1# journalctl -u nm-run -o cat | tail
<info>  [1618411262.7030] quitting now that startup is complete
<info>  [1618411262.7030] device (team0): carrier: link connected
<info>  [1618411262.7033] device (team0): team port ens2 was released
<info>  [1618411262.7033] device (team0): team port ens3 was released
<info>  [1618411262.7033] manager: NetworkManager state is now CONNECTED_SITE
<info>  [1618411262.7034] exiting (success)
nm-run.service: Deactivated successfully.
nm-run.service: Unit process 476 (teamd) remains running after unit stopped.
Finished nm-run.service.
```

modules.d/35network-manager/nm-run.service

index f3493c41a3881f57528045cfa68415f7a5836a18..b667ce3795972ddc9c706d017d4283ee5ce4ba80 100644 (file)
@@ -25,6 +25,8 @@ ConditionPathExistsGlob=|/etc/sysconfig/network-scripts/ifcfg-*
 #run the script and wait before it finishes
 Type=oneshot
 ExecStart=/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
+#don't kill forked off processes (for example: teamd for teaming)
+KillMode=process
 
 [Install]
 WantedBy=initrd.target