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:
Lukas Nykryn
2013-04-16 14:42:30 +02:00
parent 53fd7dd1ed
commit 7ab5d33c5c
4 changed files with 51 additions and 0 deletions

View File

@@ -1489,6 +1489,10 @@ SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, and SCHED_IDLE are respectively
displayed as 0, 1, 2, 3, 4, and 5.
T}
sd_unit UNIT T{
displays systemd unit which a process belongs to.
T}
sess SESS T{
session ID or, equivalently, the process ID of the session leader. (alias
.BR session , \ sid ).