chiark / gitweb /
sysv: require sysinit.service from all sysv services
authorLennart Poettering <lennart@poettering.net>
Sun, 4 Apr 2010 20:51:16 +0000 (22:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 4 Apr 2010 20:51:16 +0000 (22:51 +0200)
manager.h
service.c

index 8d46323e0e6a42706781bf31a35d93ab6fc321f2..a361748374a3c2900c9daa9f37bd9ee071aa7f41 100644 (file)
--- a/manager.h
+++ b/manager.h
@@ -82,6 +82,7 @@ struct Watch {
 #define SPECIAL_REMOTE_FS_TARGET "remote-fs.target"
 #define SPECIAL_SYSLOG_TARGET "syslog.target"             /* Should pull in syslog.socket or syslog.service */
 #define SPECIAL_RTC_SET_TARGET "rtc-set.target"           /* LSB's $time */
+#define SPECIAL_SYSINIT_SERVICE "sysinit.service"
 
 /* For SysV compatibility. Usually an alias for a saner target. On
  * SysV-free systems this doesn't exist. */
index be23b57c4979556f8bc0615bc0a12696ad0c335f..53d5505c2ea16b007607291f7e32faf54b3d8763 100644 (file)
--- a/service.c
+++ b/service.c
@@ -481,6 +481,10 @@ static int service_load_sysv_path(Service *s, const char *path) {
         if ((r = sysv_exec_commands(s)) < 0)
                 goto finish;
 
+        if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, SPECIAL_SYSINIT_SERVICE)) < 0 ||
+            (r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_SYSINIT_SERVICE)) < 0)
+                goto finish;
+
         r = 1;
 
 finish: