]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generators: change TimeoutSec=0 to TimeoutSec=infinity
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Jun 2023 07:29:51 +0000 (09:29 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 6 Jun 2023 11:38:16 +0000 (12:38 +0100)
With these settings we intend to turn off timeouts for possibly
interactive/slow commands. The officially documented way to turn off the
time-outs is to setting them to infinity. So far we set them to zero
here though.

This lead to some confusiong, for example #18224. Let's fix this by
uniformly spelling out TimeoutSec=infinity.

This doesn't change behaviour. It just makes our generated files match
what we document, without relying on historic compat support.

Fixes: #18224
14 files changed:
src/cryptsetup/cryptsetup-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/hibernate-resume/hibernate-resume-generator.c
src/integritysetup/integritysetup-generator.c
src/shared/generator.c
test/test-fstab-generator/test-12-dev-sdx.expected/systemd-fsck-root.service
test/test-fstab-generator/test-13-label.expected/systemd-fsck-root.service
test/test-fstab-generator/test-14-uuid.expected/systemd-fsck-root.service
test/test-fstab-generator/test-15-partuuid.expected/systemd-fsck-root.service
test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/systemd-fsck-root.service
test/test-fstab-generator/test-18-options.fstab.expected/systemd-fsck-root.service
test/test-fstab-generator/test-18-options.fstab.expected/systemd-makefs@dev-sdx12.service
test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy2.service
test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy3.service

index a22d9323421725ff2521fb1d4b52fff279ab5172..702b2615e29b8ff03c6cf562e1589cadb851edea 100644 (file)
@@ -562,7 +562,8 @@ static int create_disk(
         if (!noauto && !nofail) {
                 r = write_drop_in(arg_dest, dmname, 40, "device-timeout",
                                   "# Automatically generated by systemd-cryptsetup-generator\n\n"
-                                  "[Unit]\nJobTimeoutSec=0");
+                                  "[Unit]\n"
+                                  "JobTimeoutSec=infinity\n");
                 if (r < 0)
                         log_warning_errno(r, "Failed to write device timeout drop-in: %m");
         }
index 8036724034f109994a10a208c5a8b61d6595a936..77f51c4245031a07d4cc179c38fbf44f34d2d2ca 100644 (file)
@@ -142,7 +142,7 @@ static int add_cryptsetup(
         r = write_drop_in_format(arg_dest, dmname, 50, "job-timeout",
                                  "# Automatically generated by systemd-gpt-auto-generator\n\n"
                                  "[Unit]\n"
-                                 "JobTimeoutSec=0"); /* the binary handles timeouts anyway */
+                                 "JobTimeoutSec=infinity"); /* the binary handles timeouts anyway */
         if (r < 0)
                 log_warning_errno(r, "Failed to write device timeout drop-in, ignoring: %m");
 
index be52c21d00dfbe5adaddb26ed70de215bae00f9c..1bcf9d69df04c0015c0fbf2e147dcfe886941da1 100644 (file)
@@ -95,7 +95,8 @@ static int process_resume(void) {
 
         r = write_drop_in(arg_dest, device_unit, 40, "device-timeout",
                           "# Automatically generated by systemd-hibernate-resume-generator\n\n"
-                          "[Unit]\nJobTimeoutSec=0");
+                          "[Unit]\n"
+                          "JobTimeoutSec=infinity\n");
         if (r < 0)
                 log_warning_errno(r, "Failed to write device timeout drop-in: %m");
 
index 15f508902d3aee167682f2e87c1a7d76fa11f000..5df6d81a8441a312589fce77dbe812e013b8130b 100644 (file)
@@ -100,7 +100,7 @@ static int create_disk(
                 "[Service]\n"
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
-                "TimeoutSec=0\n"
+                "TimeoutSec=infinity\n"
                 "ExecStart=" ROOTLIBEXECDIR "/systemd-integritysetup attach '%s' '%s' '%s' '%s'\n"
                 "ExecStop=" ROOTLIBEXECDIR "/systemd-integritysetup detach '%s'\n",
                 name_escaped, device, empty_to_dash(key_file_escaped), empty_to_dash(options),
index 49c5fe5c05bbcb7831606f5ab6c4563b4431e49b..44ed3199222f8a3ebe0f57da5a793c5fece3ccf5 100644 (file)
@@ -235,7 +235,7 @@ static int write_fsck_sysroot_service(
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "ExecStart=" SYSTEMD_FSCK_PATH " %7$s\n"
-                "TimeoutSec=0\n",
+                "TimeoutSec=infinity\n",
                 program_invocation_short_name,
                 escaped,
                 unit,
@@ -530,7 +530,7 @@ int generator_hook_up_mkswap(
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "ExecStart="SYSTEMD_MAKEFS_PATH " swap %s\n"
-                "TimeoutSec=0\n",
+                "TimeoutSec=infinity\n",
                 program_invocation_short_name,
                 where_unit,
                 escaped);
@@ -619,7 +619,7 @@ int generator_hook_up_mkfs(
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "ExecStart="SYSTEMD_MAKEFS_PATH " %s %s\n"
-                "TimeoutSec=0\n",
+                "TimeoutSec=infinity\n",
                 program_invocation_short_name,
                 fsck_unit,
                 where_unit,
@@ -801,7 +801,7 @@ int generator_write_cryptsetup_service_section(
                 "[Service]\n"
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
-                "TimeoutSec=0\n"          /* The binary handles timeouts on its own */
+                "TimeoutSec=infinity\n"   /* The binary handles timeouts on its own */
                 "KeyringMode=shared\n"    /* Make sure we can share cached keys among instances */
                 "OOMScoreAdjust=500\n"    /* Unlocking can allocate a lot of memory if Argon2 is used */
                 "ExecStart=" SYSTEMD_CRYPTSETUP_PATH " attach '%s' '%s' '%s' '%s'\n"
index 95d943b87a04d5b746abd82c7bb832db0a5d4c66..147348899d1f15b0193fd120be91083fa8ef0b67 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
-TimeoutSec=0
+TimeoutSec=infinity
index d6c59ff6089c383fe9f884938023e6f083a1716f..85c1936bce1420e9c344b4c7987c89c5f1b2960c 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-label/Root
-TimeoutSec=0
+TimeoutSec=infinity
index cd9583c4dd01513667ec7c122543933053822e6d..1c7eaea10352249a84808f94d174556d27369328 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
-TimeoutSec=0
+TimeoutSec=infinity
index 650ed8070a6a6b5ffe891de7f847357ef5313466..ab27bfd79cca9b9c9881eb286b159cf35999d94b 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-partuuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
-TimeoutSec=0
+TimeoutSec=infinity
index 95d943b87a04d5b746abd82c7bb832db0a5d4c66..147348899d1f15b0193fd120be91083fa8ef0b67 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
-TimeoutSec=0
+TimeoutSec=infinity
index 95d943b87a04d5b746abd82c7bb832db0a5d4c66..147348899d1f15b0193fd120be91083fa8ef0b67 100644 (file)
@@ -14,4 +14,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
-TimeoutSec=0
+TimeoutSec=infinity
index 303c1ee680efadc2952a2aca7ff3a23cffcfd99c..4670c23e27d09163a686e522561a13959697f8ea 100644 (file)
@@ -15,4 +15,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-makefs ext4 /dev/sdx12
-TimeoutSec=0
+TimeoutSec=infinity
index 0911f03f62347cc3999ea67811615a4cd53a3e42..0b0e7270bab6e54e03616919b88042d4c0bf4d8c 100644 (file)
@@ -15,4 +15,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-makefs swap /dev/sdy2
-TimeoutSec=0
+TimeoutSec=infinity
index 6201fec86be690f9e334304a81b4d222e71d710e..1164c99476c7e2296e872c6e590a48a7fd3f7fa1 100644 (file)
@@ -15,4 +15,4 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/lib/systemd/systemd-makefs swap /dev/sdy3
-TimeoutSec=0
+TimeoutSec=infinity