]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
systemd: fix setting of timeouts for device units
authorMichal Sekletar <msekleta@redhat.com>
Wed, 27 Sep 2017 11:27:42 +0000 (13:27 +0200)
committerLukáš Nykrýn <lnykryn@redhat.com>
Fri, 6 Oct 2017 08:05:25 +0000 (10:05 +0200)
JobRunningTimeoutSec now affects how long can start jobs for device
units stay in the "running" state. Disabling default job timeout via
JobTimeoutSec=0 doesn't disable running state timeout. We need to set
running state timeout as well.

Note that doing this the other way around has effect on generic timeout,
i.e. disabling running state timeout disables generic timeout. But doing
it this way we would create implicit dependency on fairly new
systemd-234. However, by setting both options we don't create dependency
on specific systemd version.

modules.d/90dmsquash-live/dmsquash-generator.sh
modules.d/90livenet/livenet-generator.sh
modules.d/98dracut-systemd/rootfs-generator.sh
modules.d/99base/dracut-lib.sh

index a5bfbdf20d2210da8ba67a2ae134a1815cc9f4b2..d47cf14a995fa433bce341b10ff235f7082a6a7f 100755 (executable)
@@ -78,4 +78,5 @@ mkdir -p "$GENERATOR_DIR/$_dev.device.d"
 {
     echo "[Unit]"
     echo "JobTimeoutSec=3000"
+    echo "JobRunningTimeoutSec=3000"
 } > "$GENERATOR_DIR/$_dev.device.d/timeout.conf"
index 969ef4f29331d3c9508d1ff50ca0df53b5b26bc2..a349cd0b6ee80f3809ef9cbc8b16e52ee0800888 100755 (executable)
@@ -57,4 +57,5 @@ mkdir -p "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d"
 {
     echo "[Unit]"
     echo "JobTimeoutSec=3000"
+    echo "JobRunningTimeoutSec=3000"
 } > "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d/timeout.conf"
index eada3d1593d844829e7ddea19a1d992d8c2563f8..4ae693bbc22aa584c5cb2cbb8cef074e7dbb1440 100755 (executable)
@@ -32,6 +32,7 @@ generator_wait_for_dev()
         {
             echo "[Unit]"
             echo "JobTimeoutSec=$_timeout"
+            echo "JobRunningTimeoutSec=$_timeout"
         } > "$GENERATOR_DIR"/${_name}.device.d/timeout.conf
     fi
 }
index 80385456518bb150dc5e1f9882c55fa1800d030d..675abf22a1a99304bd96fa8413184c43da116396 100755 (executable)
@@ -938,6 +938,7 @@ set_systemd_timeout_for_dev()
             {
                 echo "[Unit]"
                 echo "JobTimeoutSec=$_timeout"
+                echo "JobRunningTimeoutSec=$_timeout"
             } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
             type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/systemd/system/${_name}.device.d/timeout.conf
             _needreload=1