units: skip modprobe@.service if the unit appears to be already loaded

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-03-05 18:43:50 +00:00
committed by Chris Down
parent ff12a7954c
commit 9cbf1e58f9
+1
View 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