From 4c3a127cb631cf5efe8a6aab3fb2884e9044ef2d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Dec 2013 01:24:39 +0100 Subject: bus: skip unit file generation for systemd itself --- src/dbus1-generator/dbus1-generator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c index 93c6392f83..31ec56e7ec 100644 --- a/src/dbus1-generator/dbus1-generator.c +++ b/src/dbus1-generator/dbus1-generator.c @@ -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; -- cgit v1.2.3-54-g00ecf