From: Zbigniew Jędrzejewski-Szmek Date: Thu, 5 Mar 2020 06:20:49 +0000 (+0100) Subject: units: skip modprobe@.service if the unit appears to be already loaded X-Git-Tag: v245~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9cbf1e58f9629af5c6b56777ee73dc6320306d6d;p=thirdparty%2Fsystemd.git 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. --- diff --git a/units/modprobe@.service b/units/modprobe@.service index 5dca2cb7718..34a0557735f 100644 --- a/units/modprobe@.service +++ b/units/modprobe@.service @@ -13,6 +13,7 @@ DefaultDependencies=no Before=sysinit.target Documentation=man:modprobe(8) ConditionCapability=CAP_SYS_MODULE +ConditionPathExists=!/sys/module/%I [Service] Type=oneshot