If I wanted to know who is logged in since when and what are the processes currently running under his control, how can I do that in systemd?
You don't need systemd for that … but there's a systemd way of doing it as well, as long as you are running the systemd-logind
daemon, or something that provides the same API.
First obtain a list of sessions:
$ systemd-loginctl list-sessions
SESSION UID USER SEAT
c89 1000 jdebp seat0
1 sessions listed.
Then for each session that you are interested in show its status:
$ systemd-loginctl session-status c89
c89 - jdebp (1000)
Since: Tue, 07 Oct 2014 20:16:20 +0100; 15s ago
Leader: 24453 (3)
Seat: seat0; vc6
TTY: /dev/tty6
Service: login; type tty; class user
Active: yes
CGroup: /user/jdebp/c89
├ 24453 login
├ 25661 -zsh
└ 25866 systemd-loginctl session-status c89
The systemd people have renamed them to loginctl
and logind
in more recent versions.
loginctl
. freedesktop.org.logind
API. freedesktop.org.Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments