ps: possibility to display systemd unit for a process
Library systemd-login offers possibility to display name of a systemd unit file for specific pid. Note that not all processes are part of a system unit/service (e.g. user processes, or kernel threads). This patch adds output option "sd_unit" which will show name of systemd unit or "-", when process does not belong to any unit. To maintain compatibility with non-systemd systems, procps must be configured with --with-systemd option to enable this option.
This commit is contained in:
18
configure.ac
18
configure.ac
@@ -264,6 +264,24 @@ then
|
||||
fi
|
||||
AC_SUBST(DEJAGNU)
|
||||
|
||||
AC_ARG_WITH([systemd],
|
||||
[AS_HELP_STRING([--with-systemd], [enable systemd support])],
|
||||
[], [with_systemd=no])
|
||||
|
||||
if test "x$with_systemd" != xno; then
|
||||
PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login], [], [
|
||||
AC_CHECK_LIB(systemd-login, sd_pid_get_unit, [have_systemd=yes], [have_systemd=no])
|
||||
if test "x$have_systemd" = xno; then
|
||||
AC_MSG_ERROR([systemd support missing/incomplete])
|
||||
fi
|
||||
SYSTEMD_LIBS="-lsystemd-login"
|
||||
])
|
||||
AM_CONDITIONAL(WITH_SYSTEMD, true)
|
||||
AC_DEFINE(WITH_SYSTEMD, 1, [enable systemd support])
|
||||
else
|
||||
AM_CONDITIONAL(WITH_SYSTEMD, false)
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
include/Makefile
|
||||
|
Reference in New Issue
Block a user