diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-07-03 14:32:35 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2021-07-03 14:32:35 +0800 |
commit | 8ee759d7cf636e5f0747691874843fc52eb02296 (patch) | |
tree | dff3296de713d77a9226fd4a32a05a7afefec03a /nixos/doc/manual/administration | |
parent | adbe4e34d61a1e6db49a4a4ffec236a1017d9507 (diff) |
nixos: nixos/doc/manual/administration/user-sessions.xml to CommonMark
Diffstat (limited to 'nixos/doc/manual/administration')
-rw-r--r-- | nixos/doc/manual/administration/running.xml | 2 | ||||
-rw-r--r-- | nixos/doc/manual/administration/user-sessions.chapter.md | 43 | ||||
-rw-r--r-- | nixos/doc/manual/administration/user-sessions.xml | 45 |
3 files changed, 44 insertions, 46 deletions
diff --git a/nixos/doc/manual/administration/running.xml b/nixos/doc/manual/administration/running.xml index 30322e7239c7f..8a5e25e717fa4 100644 --- a/nixos/doc/manual/administration/running.xml +++ b/nixos/doc/manual/administration/running.xml @@ -12,7 +12,7 @@ </partintro> <xi:include href="../from_md/administration/service-mgmt.chapter.xml" /> <xi:include href="../from_md/administration/rebooting.chapter.xml" /> - <xi:include href="user-sessions.xml" /> + <xi:include href="../from_md/administration/user-sessions.chapter.xml" /> <xi:include href="control-groups.xml" /> <xi:include href="logging.xml" /> <xi:include href="cleaning-store.xml" /> diff --git a/nixos/doc/manual/administration/user-sessions.chapter.md b/nixos/doc/manual/administration/user-sessions.chapter.md new file mode 100644 index 0000000000000..5ff468b301220 --- /dev/null +++ b/nixos/doc/manual/administration/user-sessions.chapter.md @@ -0,0 +1,43 @@ +# User Sessions {#sec-user-sessions} + +Systemd keeps track of all users who are logged into the system (e.g. on +a virtual console or remotely via SSH). The command `loginctl` allows +querying and manipulating user sessions. For instance, to list all user +sessions: + +```ShellSession +$ loginctl + SESSION UID USER SEAT + c1 500 eelco seat0 + c3 0 root seat0 + c4 500 alice +``` + +This shows that two users are logged in locally, while another is logged +in remotely. ("Seats" are essentially the combinations of displays and +input devices attached to the system; usually, there is only one seat.) +To get information about a session: + +```ShellSession +$ loginctl session-status c3 +c3 - root (0) + Since: Tue, 2013-01-08 01:17:56 CET; 4min 42s ago + Leader: 2536 (login) + Seat: seat0; vc3 + TTY: /dev/tty3 + Service: login; type tty; class user + State: online + CGroup: name=systemd:/user/root/c3 + ├─ 2536 /nix/store/10mn4xip9n7y9bxqwnsx7xwx2v2g34xn-shadow-4.1.5.1/bin/login -- + ├─10339 -bash + └─10355 w3m nixos.org +``` + +This shows that the user is logged in on virtual console 3. It also +lists the processes belonging to this session. Since systemd keeps track +of this, you can terminate a session in a way that ensures that all the +session's processes are gone: + +```ShellSession +# loginctl terminate-session c3 +``` diff --git a/nixos/doc/manual/administration/user-sessions.xml b/nixos/doc/manual/administration/user-sessions.xml deleted file mode 100644 index 9acb147ac1a68..0000000000000 --- a/nixos/doc/manual/administration/user-sessions.xml +++ /dev/null @@ -1,45 +0,0 @@ -<chapter xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:xi="http://www.w3.org/2001/XInclude" - version="5.0" - xml:id="sec-user-sessions"> - <title>User Sessions</title> - <para> - Systemd keeps track of all users who are logged into the system (e.g. on a - virtual console or remotely via SSH). The command <command>loginctl</command> - allows querying and manipulating user sessions. For instance, to list all - user sessions: -<screen> -<prompt>$ </prompt>loginctl - SESSION UID USER SEAT - c1 500 eelco seat0 - c3 0 root seat0 - c4 500 alice -</screen> - This shows that two users are logged in locally, while another is logged in - remotely. (“Seats” are essentially the combinations of displays and input - devices attached to the system; usually, there is only one seat.) To get - information about a session: -<screen> -<prompt>$ </prompt>loginctl session-status c3 -c3 - root (0) - Since: Tue, 2013-01-08 01:17:56 CET; 4min 42s ago - Leader: 2536 (login) - Seat: seat0; vc3 - TTY: /dev/tty3 - Service: login; type tty; class user - State: online - CGroup: name=systemd:/user/root/c3 - ├─ 2536 /nix/store/10mn4xip9n7y9bxqwnsx7xwx2v2g34xn-shadow-4.1.5.1/bin/login -- - ├─10339 -bash - └─10355 w3m nixos.org -</screen> - This shows that the user is logged in on virtual console 3. It also lists the - processes belonging to this session. Since systemd keeps track of this, you - can terminate a session in a way that ensures that all the session’s - processes are gone: -<screen> -<prompt># </prompt>loginctl terminate-session c3 -</screen> - </para> -</chapter> |