Commit fd353244 authored by Martin Pitt's avatar Martin Pitt
Browse files

Check for logind, not for systemd

It is possible to build systemd without logind, in which case
/sys/fs/cgroup/systemd would still exist. Check for /run/systemd/seats instead,
as recommended by systemd upstream.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html>

Drop the now unnecessary linking against libsystemd-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=696264
parent 58c06a4e
......@@ -601,7 +601,7 @@ AC_ARG_WITH(systemd,
[with_systemd=$withval], [with_systemd=auto])
PKG_CHECK_MODULES(SYSTEMD,
[libsystemd-login libsystemd-daemon],
[libsystemd-login],
[have_systemd=yes], [have_systemd=no])
if test "x$with_systemd" = "xauto" ; then
......
......@@ -25,6 +25,7 @@
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <glib/gi18n.h>
......@@ -33,7 +34,6 @@
#include <dbus/dbus-glib-lowlevel.h>
#ifdef WITH_SYSTEMD
#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
#endif
......@@ -1478,7 +1478,8 @@ gs_listener_init (GSListener *listener)
listener->priv = GS_LISTENER_GET_PRIVATE (listener);
#ifdef WITH_SYSTEMD
listener->priv->have_systemd = sd_booted () > 0;
/* check if logind is running */
listener->priv->have_systemd = (access("/run/systemd/seats/", F_OK) >= 0);
#endif
gs_listener_dbus_init (listener);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment