ps: possibility to display machine name for a process
Library systemd-login offers possibility to display the name of the VM or container which process belongs to. This patch adds output option "sd_machine" which will show machine name or "-" when the name can not be determined. To maintain compatibility with non-systemd systems, procps must be configured with --with-systemd option to enable this option.
This commit is contained in:
@@ -269,8 +269,8 @@ AC_ARG_WITH([systemd],
|
||||
[], [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])
|
||||
PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login >= 202], [], [
|
||||
AC_CHECK_LIB(systemd-login, sd_pid_get_machine_name, [have_systemd=yes], [have_systemd=no])
|
||||
if test "x$have_systemd" = xno; then
|
||||
AC_MSG_ERROR([systemd support missing/incomplete])
|
||||
fi
|
||||
|
Reference in New Issue
Block a user