summaryrefslogtreecommitdiffstats
path: root/src/shared/generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-12-03 16:06:47 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-12-03 17:20:19 +0100
commit7cecc563163f539c497ecdf5ab00729fcd8c97c1 (patch)
tree426dd98779262ebe7dabeacf538bd2cfc162cd84 /src/shared/generator.c
parentMerge pull request #14216 from jwrdegoede/hwdb-teclast-sensors (diff)
downloadsystemd-7cecc563163f539c497ecdf5ab00729fcd8c97c1.tar.xz
systemd-7cecc563163f539c497ecdf5ab00729fcd8c97c1.zip
cryptsetup-generator: unconfuse writing of the device timeout
The code was using timeout=0 as the default option string. This option string was ultimately passed to generator_write_timeouts(), which only looks for comment=systemd.device-timeout= or x-systemd.device-timeout=, i.e. the whole call path was bogus. Let's rework this: generator_write_timeouts() now writes any timeouts if configured by the user. create_disk() writes out it's own timeout, but with lower priority. Since the code path that was calling timeout=0 was not effective, the only change is that we stop overwriting the timeout if explicitly configured by the user. In both code paths, ignore failure to write.
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r--src/shared/generator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 5b571681f2..06e1ab8031 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -237,10 +237,12 @@ int generator_write_timeouts(
return log_error_errno(r, "Failed to make unit name from path: %m");
return write_drop_in_format(dir, unit, 50, "device-timeout",
- "# Automatically generated by %s\n\n"
+ "# Automatically generated by %s\n"
+ "# from supplied options \"%s\"\n\n"
"[Unit]\n"
"JobRunningTimeoutSec=%s",
program_invocation_short_name,
+ opts,
timeout);
}