]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/generator.c
Merge pull request #2222 from snakeroot/eventsplat
[thirdparty/systemd.git] / src / shared / generator.c
index cb4ebc606e676ce2603899dbe5d2ea6e874d4a79..76808cbdd51c05e0ae95bc029594bb3a1978efca 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
 #include "fileio.h"
 #include "fstab-util.h"
 #include "generator.h"
+#include "log.h"
+#include "macro.h"
 #include "mkdir.h"
-#include "mount-util.h"
 #include "path-util.h"
 #include "special.h"
 #include "string-util.h"
+#include "time-util.h"
 #include "unit-name.h"
 #include "util.h"
 
@@ -64,7 +67,7 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
                 "Description=File System Check on %2$s\n"
                 "DefaultDependencies=no\n"
                 "BindsTo=%3$s\n"
-                "After=%3$s\n"
+                "After=%3$s local-fs-pre.target\n"
                 "Before=shutdown.target\n"
                 "\n"
                 "[Service]\n"
@@ -142,7 +145,7 @@ int generator_write_fsck_deps(
                 }
 
                 fprintf(f,
-                        "RequiresOverridable=%1$s\n"
+                        "Requires=%1$s\n"
                         "After=%1$s\n",
                         fsck);
         }
@@ -187,7 +190,6 @@ int generator_write_timeouts(
 
         return write_drop_in_format(dir, unit, 50, "device-timeout",
                                     "# Automatically generated by %s\n\n"
-                                    "[Unit]\nJobTimeoutSec=" USEC_FMT,
-                                    program_invocation_short_name,
-                                    u / USEC_PER_SEC);
+                                    "[Unit]\nJobTimeoutSec=%s",
+                                    program_invocation_short_name, timeout);
 }