how to get info about the user and the processes he is running in systemd?

drpaneas

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?

JdeBP

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.

Further reading

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get info about all running processes

From Dev

How can I get a history of running processes

From Dev

How do I get systemd to correctly manage a script with background processes?

From Dev

Python - How to get more info about SyntaxError?

From Dev

How to get the info about the clicked point of interest?

From Dev

How to get details info about pokemons in pokeAPI

From Dev

How to get more info about socket file?

From Dev

How to get the info about the clicked point of interest?

From Dev

Get list of running processes

From Dev

Which user is running the most processes?

From Dev

How To Get user birthday Info graph api

From Dev

How to get user info in PayPal REST API

From Dev

How to get all processes running on each CPU core in Ubuntu?

From Dev

How to get all processes, currently running in kernel mode?

From Dev

How to get the user profile info thats associated with the user session ID?

From Dev

Get list of running processes with PHP

From Dev

not able to get user info

From Dev

How to get detailed log/info about rabbitmq connection action?

From Dev

How does the Linux kernel get info about the processors and the cores?

From Dev

How does a computer get info about a connected monitor?

From Dev

How to get detailed log/info about rabbitmq connection action?

From Dev

fdisk with option '-l' - how does it get info about device?

From Dev

How to get maximum number of processes for a user in windows in C++

From Dev

How to get user in systemd unit who caused an event

From Dev

Get all processes for Current User

From Dev

Get all processes for Current User

From Dev

How to notify the user about received GTalk chats when the app is not running

From Dev

htop shows only the processes of the user that's running it?

From Dev

Running a systemd service as a user other than root!

Related Related

  1. 1

    Get info about all running processes

  2. 2

    How can I get a history of running processes

  3. 3

    How do I get systemd to correctly manage a script with background processes?

  4. 4

    Python - How to get more info about SyntaxError?

  5. 5

    How to get the info about the clicked point of interest?

  6. 6

    How to get details info about pokemons in pokeAPI

  7. 7

    How to get more info about socket file?

  8. 8

    How to get the info about the clicked point of interest?

  9. 9

    Get list of running processes

  10. 10

    Which user is running the most processes?

  11. 11

    How To Get user birthday Info graph api

  12. 12

    How to get user info in PayPal REST API

  13. 13

    How to get all processes running on each CPU core in Ubuntu?

  14. 14

    How to get all processes, currently running in kernel mode?

  15. 15

    How to get the user profile info thats associated with the user session ID?

  16. 16

    Get list of running processes with PHP

  17. 17

    not able to get user info

  18. 18

    How to get detailed log/info about rabbitmq connection action?

  19. 19

    How does the Linux kernel get info about the processors and the cores?

  20. 20

    How does a computer get info about a connected monitor?

  21. 21

    How to get detailed log/info about rabbitmq connection action?

  22. 22

    fdisk with option '-l' - how does it get info about device?

  23. 23

    How to get maximum number of processes for a user in windows in C++

  24. 24

    How to get user in systemd unit who caused an event

  25. 25

    Get all processes for Current User

  26. 26

    Get all processes for Current User

  27. 27

    How to notify the user about received GTalk chats when the app is not running

  28. 28

    htop shows only the processes of the user that's running it?

  29. 29

    Running a systemd service as a user other than root!

HotTag

Archive