chiark / gitweb /
vconsole-setup: ignore empty strings like FOO="", imported from config files
[elogind.git] / src / service.c
index 5706d7c490273d1a2269e6f37309e4d3e336bff9..021bc86766978d0135f3d42b57e0dadec89231c6 100644 (file)
@@ -280,6 +280,10 @@ static int sysv_translate_facility(const char *name, char **_r) {
         unsigned i;
         char *r;
 
+        /* SuSE insserv extension */
+        if (streq(name, "$null"))
+                return 0;
+
         for (i = 0; i < ELEMENTSOF(table); i += 2)
                 if (streq(table[i], name)) {
                         if (!(r = strdup(table[i+1])))
@@ -289,6 +293,7 @@ static int sysv_translate_facility(const char *name, char **_r) {
                 }
 
         if (*name == '$')
+                /* This is a heuristic. */
                 r = unit_name_build(name+1, NULL, ".target");
         else
                 r = sysv_translate_name(name);
@@ -581,6 +586,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
+                                        if (streq(n, file_name_from_path(path))) {
+                                                free(n);
+                                                continue;
+                                        }
+
                                         r = sysv_translate_facility(n, &m);
                                         free(n);
 
@@ -626,6 +636,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
+                                        if (streq(n, file_name_from_path(path))) {
+                                                free(n);
+                                                continue;
+                                        }
+
                                         r = sysv_translate_facility(n, &m);
                                         free(n);