chiark / gitweb /
execute: reopen console in the spawned processes, if necessary
[elogind.git] / src / service.c
index 2515cd305f2e7686a78b54daf329cb9572a9bdd3..3e2a499ec86bc73554672e02e3e789d6863cb46e 100644 (file)
@@ -649,6 +649,12 @@ static int service_load_sysv_name(Service *s, const char *name) {
         assert(s);
         assert(name);
 
+        /* For SysV services we strip the boot. or .sh
+         * prefixes/suffixes. */
+        if (startswith(name, "boot.") ||
+            endswith(name, ".sh.service"))
+                return -ENOENT;
+
         STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
                 char *path;
                 int r;
@@ -662,7 +668,7 @@ static int service_load_sysv_name(Service *s, const char *name) {
                 r = service_load_sysv_path(s, path);
 
                 if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
-                        /* Try Debian style .sh source'able init scripts */
+                        /* Try Debian style xxx.sh source'able init scripts */
                         strcat(path, ".sh");
                         r = service_load_sysv_path(s, path);
                 }
@@ -670,7 +676,7 @@ static int service_load_sysv_name(Service *s, const char *name) {
                 free(path);
 
                 if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
-                        /* Try Suse style boot.xxxx init scripts */
+                        /* Try Suse style boot.xxx init scripts */
 
                         if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
                                 return -ENOMEM;