]> code.delx.au - pulseaudio/blobdiff - src/modules/module-console-kit.c
systemd: complement module-console-kit with module-systemd-login
[pulseaudio] / src / modules / module-console-kit.c
index 4c5857cf28f3e084c5b86d6930b608eb0dcfc280..29f7e663413b649acd0505fac727310f498760d5 100644 (file)
 #include <stdlib.h>
 #include <sys/types.h>
 
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-login.h>
+#include <systemd/sd-daemon.h>
+#endif
+
 #include <pulse/xmalloc.h>
 
 #include <pulsecore/module.h>
@@ -280,6 +285,13 @@ int pa__init(pa_module*m) {
 
     dbus_error_init(&error);
 
+#ifdef HAVE_SYSTEMD
+    /* If systemd support is enabled and we boot on systemd we
+       shouldn't watch ConsoleKit but systemd's logind service. */
+    if (sd_booted() > 0)
+        return 0;
+#endif
+
     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
         pa_log("Failed to parse module arguments");
         goto fail;