chiark / gitweb /
cryptsetup-generator: add JobTimeoutSec=0 for the decrypted crypt devices
[elogind.git] / src / cryptsetup / cryptsetup-generator.c
index 6b9bc554be39b70dbe6cbc073ffda1909a914106..fd2080b539b75fdfd5457819c0bbeec9b25151a4 100644 (file)
@@ -213,6 +213,23 @@ static int create_disk(
                 return -errno;
         }
 
+        if (!noauto && !nofail) {
+                int r;
+                free(p);
+                p = strjoin(arg_dest, "/dev-mapper-", e, ".device.d/50-job-timeout-sec-0.conf", NULL);
+                if (!p)
+                        return log_oom();
+
+                mkdir_parents_label(p, 0755);
+
+                r = write_string_file(p,
+                                "# Automatically generated by systemd-cryptsetup-generator\n\n"
+                                "[Unit]\n"
+                                "JobTimeoutSec=0\n"); /* the binary handles timeouts anyway */
+                if (r)
+                        return r;
+        }
+
         return 0;
 }