h***@redhat.com
2013-04-03 13:34:30 UTC
From: Harald Hoyer <***@redhat.com>
put JobTimeoutSec=0 in <device-unit>.d/JobTimeoutSec0.conf files
This helps with grabbing a cup of coffee while booting and not have the
crypto password dialog timeout and systemd in a failed state.
This is even needed for "timeout=0" in /etc/crypttab!
---
src/cryptsetup/cryptsetup-generator.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 6b9bc55..5ca9529 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -213,6 +213,35 @@ static int create_disk(
return -errno;
}
+ if (!noauto && !nofail) {
+ free(p);
+ p = strjoin(arg_dest, "/dev-mapper-", e, ".device.d/50-JobTimeoutSec0.conf", NULL);
+ if (!p)
+ return log_oom();
+
+ mkdir_parents_label(p, 0755);
+
+ if (f)
+ fclose(f);
+ f = fopen(p, "wxe");
+ if (!f) {
+ log_error("Failed to create unit file %s: %m", p);
+ return -errno;
+ }
+
+ fprintf(f,
+ "# Automatically generated by systemd-cryptsetup-generator\n\n"
+ "[Unit]\n"
+ "JobTimeoutSec=0\n" /* the binary handles timeouts anyway */
+ );
+ fflush(f);
+
+ if (ferror(f)) {
+ log_error("Failed to write file %s: %m", p);
+ return -errno;
+ }
+ }
+
return 0;
}
put JobTimeoutSec=0 in <device-unit>.d/JobTimeoutSec0.conf files
This helps with grabbing a cup of coffee while booting and not have the
crypto password dialog timeout and systemd in a failed state.
This is even needed for "timeout=0" in /etc/crypttab!
---
src/cryptsetup/cryptsetup-generator.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 6b9bc55..5ca9529 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -213,6 +213,35 @@ static int create_disk(
return -errno;
}
+ if (!noauto && !nofail) {
+ free(p);
+ p = strjoin(arg_dest, "/dev-mapper-", e, ".device.d/50-JobTimeoutSec0.conf", NULL);
+ if (!p)
+ return log_oom();
+
+ mkdir_parents_label(p, 0755);
+
+ if (f)
+ fclose(f);
+ f = fopen(p, "wxe");
+ if (!f) {
+ log_error("Failed to create unit file %s: %m", p);
+ return -errno;
+ }
+
+ fprintf(f,
+ "# Automatically generated by systemd-cryptsetup-generator\n\n"
+ "[Unit]\n"
+ "JobTimeoutSec=0\n" /* the binary handles timeouts anyway */
+ );
+ fflush(f);
+
+ if (ferror(f)) {
+ log_error("Failed to write file %s: %m", p);
+ return -errno;
+ }
+ }
+
return 0;
}
--
1.8.2
1.8.2