]> granicus.if.org Git - procps-ng/commitdiff
Add support for elogind
authorSven Eden <yamakuzure@gmx.net>
Tue, 30 May 2017 14:33:28 +0000 (16:33 +0200)
committerCraig Small <csmall@dropbear.xyz>
Fri, 1 Apr 2022 06:24:38 +0000 (06:24 +0000)
A session manager similar to logind from systemd.
See https://github.com/elogind/elogind

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Makefile.am
configure.ac
proc/readproc.c

index eedc7dc5a4859320e92368a33262495f305f2b7b..4059e1303a3bc05d54efa024538247e89d0883ad 100644 (file)
@@ -246,6 +246,10 @@ if WITH_SYSTEMD
 proc_libproc_2_la_LIBADD += @SYSTEMD_LIBS@
 endif
 
+if WITH_ELOGIND
+proc_libproc_2_la_LIBADD += @ELOGIND_LIBS@
+endif
+
 proc_libproc_2_la_LDFLAGS = \
        -version-info $(LIBproc_2_CURRENT):$(LIBproc_2_REVISION):$(LIBproc_2_AGE) \
        -no-undefined \
index 1d303b9506bb49a670c781404f072e08d5afc4eb..951d77bfddab97e2a7137bcc9ae9ddbfbca9b873 100644 (file)
@@ -249,6 +249,19 @@ AS_IF([test "x$with_systemd" != "xno"], [
 ])
 AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno])
 
+AC_ARG_WITH([elogind],
+  [AS_HELP_STRING([--with-elogind], [enable elogind support])],
+  [], [with_elogind=no]
+)
+# Do not allow elogind if systemd is wanted and found
+AS_IF([test "x$with_systemd" != "xno"], [with_elogind=no])
+
+AS_IF([test "x$with_elogind" != "xno"], [
+  PKG_CHECK_MODULES([ELOGIND], [libelogind])
+  AC_DEFINE(WITH_ELOGIND, 1, [enable elogind support])
+])
+AM_CONDITIONAL([WITH_ELOGIND], [test x$with_elogind != xno])
+
 # AC_ARG_ENABLEs
 AC_ARG_ENABLE([pidof],
   AS_HELP_STRING([--disable-pidof], [do not build pidof]),
index a956f43822ad178d2f8794de314956cf0ef76fca..41888cca4444b8eeffb0ad7f059e1de7752af203 100644 (file)
@@ -35,6 +35,9 @@
 #ifdef WITH_SYSTEMD
 #include <systemd/sd-login.h>
 #endif
+#ifdef WITH_ELOGIND
+#include <elogind/sd-login.h>
+#endif
 
 #include "devname.h"
 #include "escape.h"
@@ -495,7 +498,7 @@ static inline void oomadj2proc(const char *S, proc_t *restrict P)
 ///////////////////////////////////////////////////////////////////////
 
 static int sd2proc (proc_t *restrict p) {
-#ifdef WITH_SYSTEMD
+#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
     char buf[64];
     uid_t uid;