chiark / gitweb /
bus: skip unit file generation for systemd itself
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Dec 2013 00:24:39 +0000 (01:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Dec 2013 00:24:39 +0000 (01:24 +0100)
src/dbus1-generator/dbus1-generator.c

index 93c6392..31ec56e 100644 (file)
@@ -183,6 +183,11 @@ static int add_dbus(const char *path, const char *fname, const char *type) {
                 return 0;
         }
 
+        if (streq(name, "org.freedesktop.systemd1")) {
+                log_debug("Skipping %s, identified as systemd.", p);
+                return 0;
+        }
+
         if (service) {
                 if (!unit_name_is_valid(service, false)) {
                         log_warning("Unit name %s is not valid, ignoring.", service);
@@ -193,7 +198,7 @@ static int add_dbus(const char *path, const char *fname, const char *type) {
                         return 0;
                 }
         } else {
-                if (!exec) {
+                if (streq(exec, "/bin/false") || !exec) {
                         log_warning("Neither service name nor binary path specified, ignoring %s.", p);
                         return 0;
                 }
@@ -219,7 +224,7 @@ static int parse_dbus_fragments(void) {
                 type = "session";
         } else if (r == -ENOENT) {
                 p = "/usr/share/dbus-1/system-services";
-                type = "systemd";
+                type = "system";
         } else if (r < 0) {
                 log_error("Failed to determine whether we are running as user or system instance: %s", strerror(-r));
                 return r;