loginctl user status что это

SYNOPSIS¶

loginctl may be used to introspect and control the state of the

The following commands are understood:

Session Commands¶

User Commands¶

Seat Commands¶

System Commands¶

If the optional argument —firmware-setup is given, indicate to the system’s firmware to reboot into the firmware setup interface. Note that this functionality is not available on all systems.

Hook directories¶

Note that scripts or binaries dropped in any of the hook directories are intended for local use only and should be considered hacks. If applications want to react to these system commands, they should rather use the Inhibitor interface[1].

OPTIONS¶

The following options are understood:

EXIT STATUS¶

On success, 0 is returned, a non-zero failure code otherwise.

EXAMPLES¶

Example 1. Querying user status

There are two sessions, 2 and 3. The session 2 is a graphical session, marked with a star. Uptime, state, lingering state und the user unit are shown. The user unit is an artificial construct, elogind does not really support systemd units and slices.

ENVIRONMENT¶

Users might want to change two options in particular:

If the value of $SYSTEMD_LESS does not include «K», and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.

See less(1) for more discussion.

Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. «Secure» mode for the pager may be enabled automatically as describe above. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to completly disable the pager using —no-pager instead.

Источник

SYNOPSIS¶

loginctl may be used to introspect and control the state of the systemd(1) login manager systemd-logind.service(8).

The following commands are understood:

Session Commands¶

User Commands¶

See also KillUserProcesses= setting in logind.conf(5).

Seat Commands¶

OPTIONS¶

The following options are understood:

EXIT STATUS¶

On success, 0 is returned, a non-zero failure code otherwise.

EXAMPLES¶

Example 1. Querying user status

There are two sessions, 3 and 5. Session 3 is a graphical session, marked with a star. The tree of processing including the two corresponding scope units and the user manager unit are shown.

ENVIRONMENT¶

Users might want to change two options in particular:

If the value of $SYSTEMD_LESS does not include «K», and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.

See less(1) for more discussion.

Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. «Secure» mode for the pager may be enabled automatically as describe above. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to completely disable the pager using —no-pager instead.

Источник

LOGINCTL


SYNOPSIS


DESCRIPTION

loginctl may be used to introspect and control the state of the systemd (1) login manager systemd-logind.service (8).

COMMANDS

The following commands are understood:

Session Commands

list-sessions List current sessions.

activate [ ID ] Activate a session. This brings a session into the foreground if another session is currently in the foreground on the respective seat. Takes a session identifier as argument. If no argument is specified, the session of the caller is put into foreground.

User Commands

list-users List currently logged in users.

See also KillUserProcesses= setting in logind.conf (5).

Seat Commands

list-seats List currently available seats on the local system.

OPTIONS

The following options are understood:

—no-ask-password Do not query the user for authentication for privileged operations.

—value When showing session/user/seat properties, only print the value, and skip the property name and «=».

The special value «help» will list the known values and the program will exit immediately, and the special value «list» will list known values along with the numerical signal numbers and the program will exit immediately.

—no-pager Do not pipe output into a pager.

—no-legend Do not print the legend, i.e. column headers and the footer with hints.

—version Print a short version string and exit.

EXIT STATUS

On success, 0 is returned, a non-zero failure code otherwise.

EXAMPLES

Example 1. Querying user status

There are two sessions, 3 and 5. Session 3 is a graphical session, marked with a star. The tree of processing including the two corresponding scope units and the user manager unit are shown.

ENVIRONMENT

$SYSTEMD_LOG_COLOR A boolean. If true, messages written to the tty will be colored according to priority.

This setting is only useful when messages are written directly to the terminal, because journalctl (1) and other tools that display logs will color messages based on the log level on their own.

$SYSTEMD_LOG_TIME A boolean. If true, log messages will be prefixed with a timestamp.

This setting is only useful when messages are written directly to the terminal or a file, because journalctl (1) and other tools that display logs will attach timestamps based on the entry metadata on their own.

$SYSTEMD_LOG_LOCATION A boolean. If true, messages will be prefixed with a filename and line number in the source code where the message originates.

Note that the log location is often attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs.

$SYSTEMD_LOG_TID A boolean. If true, messages will be prefixed with the current numerical thread ID (TID).

Note that the this information is attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs.

$SYSTEMD_LOG_TARGET The destination for log messages. One of console (log to the attached tty), console-prefixed (log to the attached tty but with prefixes encoding the log level and «facility», see syslog (3), kmsg (log to the kernel circular log buffer), journal (log to the journal), journal-or-kmsg (log to the journal if available, and to kmsg otherwise), auto (determine the appropriate log target automatically, the default), null (disable log output).

$SYSTEMD_LESS Override the options passed to less (by default «FRSXMK»).

Users might want to change two options in particular:

K This option instructs the pager to exit immediately when Ctrl+C is pressed. To allow less to handle Ctrl+C itself to switch back to the pager command prompt, unset this option.

X This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal. It is set by default to allow command output to remain visible in the terminal even after the pager exits. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse.

See less (1) for more discussion.

$SYSTEMD_LESSCHARSET Override the charset passed to less (by default «utf-8», if the invoking terminal is determined to be UTF-8 compatible).

Источник

Loginctl user status что это

may be used to introspect and control the state of the systemd(1) login manager systemd-logind.service(8).

OPTIONS

The following options are understood:

Do not query the user for authentication for privileged operations.

When showing session/user/seat properties, limit display to certain properties as specified as argument. If not specified, all set properties are shown. The argument should be a property name, such as «Sessions». If specified more than once, all properties with the specified names are shown.

When printing properties with show, only print the value, and skip the property name and «=».

When showing session/user/seat properties, show all properties regardless of whether they are set or not.

Do not ellipsize process tree entries.

When used with kill-session, choose which processes to kill. Must be one of leader, or all to select whether to kill only the leader process of the session or all processes of the session. If omitted, defaults to all.

When used with kill-session or kill-user, choose which signal to send to selected processes. Must be one of the well known signal specifiers, such as SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.

When used with user-status and session-status, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument. Defaults to 10.

When used with user-status and session-status, controls the formatting of the journal entries that are shown. For the available choices, see journalctl(1). Defaults to «short».

Execute operation on a local container. Specify a container name to connect to.

Do not pipe output into a pager.

Do not print the legend, i.e. column headers and the footer with hints.

Print a short help text and exit.

Print a short version string and exit.

COMMANDS

The following commands are understood:

Session Commands

List current sessions.

Show terse runtime status information about one or more sessions, followed by the most recent log data from the journal. Takes one or more session identifiers as parameters. If no session identifiers are passed, the status of the caller’s session is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-session instead.

Show properties of one or more sessions or the manager itself. If no argument is specified, properties of the manager will be shown. If a session ID is specified, properties of the session are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use session-status if you are looking for formatted human-readable output.

Activate a session. This brings a session into the foreground if another session is currently in the foreground on the respective seat. Takes a session identifier as argument. If no argument is specified, the session of the caller is put into foreground.

Activates/deactivates the screen lock on one or more sessions, if the session supports it. Takes one or more session identifiers as arguments. If no argument is specified, the session of the caller is locked/unlocked.

Activates/deactivates the screen lock on all current sessions supporting it.

Terminates a session. This kills all processes of the session and deallocates all resources attached to the session.

Send a signal to one or more processes of the session. Use —kill-who= to select which process to kill. Use —signal= to select the signal to send.

User Commands

List currently logged in users.

Show terse runtime status information about one or more logged in users, followed by the most recent log data from the journal. Takes one or more user names or numeric user IDs as parameters. If no parameters are passed, the status of the caller’s user is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-user instead. Users may be specified by their usernames or numeric user IDs.

Show properties of one or more users or the manager itself. If no argument is specified, properties of the manager will be shown. If a user is specified, properties of the user are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use user-status if you are looking for formatted human-readable output.

Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run long-running services. Takes one or more user names or numeric UIDs as argument. If no argument is specified, enables/disables lingering for the user of the session of the caller.

See also KillUserProcesses= setting in logind.conf(5).

Terminates all sessions of a user. This kills all processes of all sessions of the user and deallocates all runtime resources attached to the user.

Send a signal to all processes of a user. Use —signal= to select the signal to send.

Seat Commands

List currently available seats on the local system.

Show terse runtime status information about one or more seats. Takes one or more seat names as parameters. If no seat names are passed the status of the caller’s session’s seat is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-seat instead.

Show properties of one or more seats or the manager itself. If no argument is specified, properties of the manager will be shown. If a seat is specified, properties of the seat are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use seat-status if you are looking for formatted human-readable output.

Persistently attach one or more devices to a seat. The devices should be specified via device paths in the /sys file system. To create a new seat, attach at least one graphics card to a previously unused seat name. Seat names may consist only of a-z, A-Z, 0-9, «-» and «_» and must be prefixed with «seat». To drop assignment of a device to a specific seat, just reassign it to a different seat, or use flush-devices.

Removes all device assignments previously created with attach. After this call, only automatically generated seats will remain, and all seat hardware is assigned to them.

Terminates all sessions on a seat. This kills all processes of all sessions on the seat and deallocates all runtime resources attached to them.

EXIT STATUS

On success, 0 is returned, a non-zero failure code otherwise.

EXAMPLES

Example 1. Querying user status

There are two sessions, 3 and 5. Session 3 is a graphical session, marked with a star. The tree of processing including the two corresponding scope units and the user manager unit are shown.

ENVIRONMENT

Pager to use when —no-pager is not given; overrides $PAGER. Setting this to an empty string or the value «cat» is equivalent to passing —no-pager.

Override the default options passed to less («FRSXMK»).

Источник

loginctl

Control the systemd login manager

SYNOPSIS

DESCRIPTION

loginctl may be used to introspect and control the state of the systemd(1) login manager systemd-logind.service(8).

COMMANDS

The following commands are understood:

Session Commands

Show terse runtime status information about one or more sessions, followed by the most recent log data from the journal. Takes one or more session identifiers as parameters. If no session identifiers are passed, the status of the callers session is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-session instead.

Show properties of one or more sessions or the manager itself. If no argument is specified, properties of the manager will be shown. If a session ID is specified, properties of the session are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use session-status if you are looking for formatted human-readable output.

Activate a session. This brings a session into the foreground if another session is currently in the foreground on the respective seat. Takes a session identifier as argument. If no argument is specified, the session of the caller is put into foreground.

Activates/deactivates the screen lock on one or more sessions, if the session supports it. Takes one or more session identifiers as arguments. If no argument is specified, the session of the caller is locked/unlocked.

Activates/deactivates the screen lock on all current sessions supporting it.

Terminates a session. This kills all processes of the session and deallocates all resources attached to the session.

Send a signal to one or more processes of the session. Use —kill-who= to select which process to kill. Use —signal= to select the signal to send.

User Commands

List currently logged in users.

Show terse runtime status information about one or more logged in users, followed by the most recent log data from the journal. Takes one or more user names or numeric user IDs as parameters. If no parameters are passed, the status is shown for the user of the session of the caller. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-user instead.

Show properties of one or more users or the manager itself. If no argument is specified, properties of the manager will be shown. If a user is specified, properties of the user are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use user-status if you are looking for formatted human-readable output.

Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run long-running services. Takes one or more user names or numeric UIDs as argument. If no argument is specified, enables/disables lingering for the user of the session of the caller.

See also KillUserProcesses= setting in logind.conf(5).

Terminates all sessions of a user. This kills all processes of all sessions of the user and deallocates all runtime resources attached to the user.

Send a signal to all processes of a user. Use —signal= to select the signal to send.

Seat Commands

List currently available seats on the local system.

Show terse runtime status information about one or more seats. Takes one or more seat names as parameters. If no seat names are passed the status of the callers sessions seat is shown. This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show-seat instead.

Show properties of one or more seats or the manager itself. If no argument is specified, properties of the manager will be shown. If a seat is specified, properties of the seat are shown. By default, empty properties are suppressed. Use —all to show those too. To select specific properties to show, use —property=. This command is intended to be used whenever computer-parsable output is required. Use seat-status if you are looking for formatted human-readable output.

Persistently attach one or more devices to a seat. The devices should be specified via device paths in the /sys/ file system. To create a new seat, attach at least one graphics card to a previously unused seat name. Seat names may consist only of a–z, A–Z, 0–9, «-» and «_» and must be prefixed with «seat». To drop assignment of a device to a specific seat, just reassign it to a different seat, or use flush-devices.

Removes all device assignments previously created with attach. After this call, only automatically generated seats will remain, and all seat hardware is assigned to them.

Terminates all sessions on a seat. This kills all processes of all sessions on the seat and deallocates all runtime resources attached to them.

OPTIONS

The following options are understood:

Do not query the user for authentication for privileged operations.

When showing session/user/seat properties, limit display to certain properties as specified as argument. If not specified, all set properties are shown. The argument should be a property name, such as «Sessions». If specified more than once, all properties with the specified names are shown.

When showing session/user/seat properties, only print the value, and skip the property name and «=».

When showing session/user/seat properties, show all properties regardless of whether they are set or not.

Do not ellipsize process tree entries.

When used with kill-session, choose which processes to kill. Must be one of leader, or all to select whether to kill only the leader process of the session or all processes of the session. If omitted, defaults to all.

When used with kill-session or kill-user, choose which signal to send to selected processes. Must be one of the well known signal specifiers, such as SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.

When used with user-status and session-status, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument. Defaults to 10.

When used with user-status and session-status, controls the formatting of the journal entries that are shown. For the available choices, see journalctl(1). Defaults to «short».

Execute operation on a local container. Specify a container name to connect to.

Do not pipe output into a pager.

Do not print the legend, i.e. column headers and the footer with hints.

Print a short help text and exit.

Print a short version string and exit.

EXIT STATUS

On success, 0 is returned, a non-zero failure code otherwise.

EXAMPLES

Example 1. Querying user status

There are two sessions, 3 and 5. Session 3 is a graphical session, marked with a star. The tree of processing including the two corresponding scope units and the user manager unit are shown.

ENVIRONMENT

Pager to use when —no-pager is not given; overrides $PAGER. If neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known pager implementations are tried in turn, including less(1) and more(1), until one is found. If no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string or the value «cat» is equivalent to passing —no-pager.

Override the options passed to less (by default «FRSXMK»).

Users might want to change two options in particular:

This option instructs the pager to exit immediately when Ctrl+C is pressed. To allow less to handle Ctrl+C itself to switch back to the pager command prompt, unset this option.

If the value of $SYSTEMD_LESS does not include «K», and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.

This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal. It is set by default to allow command output to remain visible in the terminal even after the pager exits. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse.

See less(1) for more discussion.

Override the charset passed to less (by default «utf-8», if the invoking terminal is determined to be UTF-8 compatible).

Takes a boolean argument. When true, the «secure» mode of the pager is enabled; if false, disabled. If $SYSTEMD_PAGERSECURE is not set at all, secure mode is enabled if the effective UID is not the same as the owner of the login session, see geteuid(2) and sd_pid_get_owner_uid(3). In secure mode, LESSSECURE=1 will be set when invoking the pager, and the pager shall disable commands that open or create new files or start new subprocesses. When $SYSTEMD_PAGERSECURE is not set at all, pagers which are not known to implement secure mode will not be used. (Currently only less(1) implements secure mode.)

Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. «Secure» mode for the pager may be enabled automatically as describe above. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to completely disable the pager using —no-pager instead.

The value must be a boolean. Controls whether colorized output should be generated. This can be specified to override the decision that systemd makes based on $TERM and what the console is connected to.

The value must be a boolean. Controls whether clickable links should be generated in the output for terminal emulators supporting this. This can be specified to override the decision that systemd makes based on $TERM and other conditions.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *