systemd: complement module-console-kit with module-systemd-login

ConsoleKit has been deprecated and replaced by systemd's logind daemon,
hence provide the same functionality of module-console-kit in
module-systemd-login. This also makes sure that the CK module becomes a
NOP if the system is booted with systemd, resp. that the systemd module
becomes a NOP if the system is booted without systemd, thus being nice
to OSes such as Debian which want to support multiple init systems.
This commit is contained in:
Lennart Poettering 2012-03-17 01:52:41 +01:00
parent e83ebabc68
commit 860d1cf3a7
5 changed files with 289 additions and 2 deletions

View file

@ -30,6 +30,11 @@
#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;