XK0-005 · Question #879
Before a Linux administrator restarts a system using systemd, the administrator wants to know if any of the server users are currently logged in. Which of the following commands should the…
The correct answer is A. loginctl list-sessions. 'loginctl list-sessions' is the correct command to list all currently active user login sessions on a systemd-based Linux system. It shows session ID, user, seat, and TTY information, allowing the administrator to confirm whether anyone is logged in before rebooting. Option B…
Question
Before a Linux administrator restarts a system using systemd, the administrator wants to know if any of the server users are currently logged in. Which of the following commands should the administrator use to verify that the server is not being used?
Options
- Aloginctl list-sessions
- Bjournalctl -u
- Csystemctl status user-sessions
- Dsystemd --user
How the community answered
(46 responses)- A91% (42)
- B2% (1)
- C4% (2)
- D2% (1)
Explanation
'loginctl list-sessions' is the correct command to list all currently active user login sessions on a systemd-based Linux system. It shows session ID, user, seat, and TTY information, allowing the administrator to confirm whether anyone is logged in before rebooting. Option B ('journalctl -u') queries the systemd journal for a specific unit and requires a unit name argument - it does not list active sessions. Option C ('systemctl status user-sessions') is not a standard command for this purpose. Option D ('systemd --user') starts a user systemd instance, not a session listing tool.
Topics
Community Discussion
No community discussion yet for this question.