]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: skip modprobe@.service if the unit appears to be already loaded
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 5 Mar 2020 06:20:49 +0000 (07:20 +0100)
committerChris Down <chris@chrisdown.name>
Thu, 5 Mar 2020 18:43:50 +0000 (18:43 +0000)
Possible alternative to #14819.

For me, setting RemainAfterExit=yes would be OK, but if people think that it
might cause issues, then this could be a reasonable alternative that still
let's us skip the invocation of the separate binary.

units/modprobe@.service

index 5dca2cb77187e249efb9f4b5f71343cdd8d50565..34a0557735f18f648105ecdc83884c65de1ce55d 100644 (file)
@@ -13,6 +13,7 @@ DefaultDependencies=no
 Before=sysinit.target
 Documentation=man:modprobe(8)
 ConditionCapability=CAP_SYS_MODULE
+ConditionPathExists=!/sys/module/%I
 
 [Service]
 Type=oneshot