Home Explore Blog CI



man-pages

29th chunk of `systemctl.man`
2e1cc2344b55f564427fca73fea02582b2fd2aac04e663e7000000010000152c
 use SSH to talk to the remote machine manager instance. Container names may be enumerated with
           machinectl -H HOST. Put IPv6 addresses in brackets.

       -M, --machine=
           Execute operation on a local container. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating "@" character. If the special string ".host" is used in place of
           the container name, a connection to the local system is made (which is useful to connect to a specific user's user bus: "--user --machine=lennart@.host"). If the "@" syntax is not used, the connection is made as
           root user. If the "@" syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and ".host" are implied.

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

       --legend=BOOL
           Enable or disable printing of the legend, i.e. column headers and the footer with hints. The legend is printed by default, unless disabled with --quiet or similar.

       -h, --help
           Print a short help text and exit.

       --version
           Print a short version string and exit.

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

       systemctl uses the return codes defined by LSB, as defined in LSB 3.0.0[2].

       Table 3. LSB return codes
       ┌───────┬──────────────────────────────────────────────────┬─────────────────────────────────────┐
       │ Value │ Description in LSB                               │ Use in systemd                      │
       ├───────┼──────────────────────────────────────────────────┼─────────────────────────────────────┤
       │ 0     │ "program is running or service is OK"            │ unit is active                      │
       ├───────┼──────────────────────────────────────────────────┼─────────────────────────────────────┤
       │ 1     │ "program is dead and /var/run pid file exists"   │ unit not failed (used by is-failed) │
       ├───────┼──────────────────────────────────────────────────┼─────────────────────────────────────┤
       │ 2     │ "program is dead and /var/lock lock file exists" │ unused                              │
       ├───────┼──────────────────────────────────────────────────┼─────────────────────────────────────┤
       │ 3     │ "program is not running"                         │ unit is not active                  │
       ├───────┼──────────────────────────────────────────────────┼─────────────────────────────────────┤
       │ 4     │ "program or service status is unknown"           │ no such unit                        │
       └───────┴──────────────────────────────────────────────────┴─────────────────────────────────────┘

       The mapping of LSB service states to systemd unit states is imperfect, so it is better to not rely on those return values but to look for specific unit states and substates instead.

ENVIRONMENT
       $SYSTEMD_EDITOR
           Editor to use when editing units; overrides $EDITOR and $VISUAL. If neither $SYSTEMD_EDITOR nor $EDITOR nor $VISUAL are present or if it is set to an empty string or if their execution failed, systemctl will try
           to execute well known editors in this order: editor(1), nano(1), vim(1), vi(1).

       $SYSTEMD_LOG_LEVEL
           The maximum log level of emitted messages (messages with a higher log level, i.e. less important ones, will be suppressed). Either one of (in order of decreasing importance) emerg, alert, crit, err, warning,
           notice, info, debug, or an integer in the range 0...7. See syslog(3) for more information.

       $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.

Title: Systemctl: Remote Execution, Output Control, Help Options, Exit Status, and Environment Variables
Summary
This section describes how to execute systemctl operations on remote machines and local containers using the `-H` and `-M` options, respectively. It also covers options to control output, such as disabling the pager with `--no-pager` and enabling/disabling the legend with `--legend`. The section details the help and version options, the exit status codes used by systemctl following LSB standards, and environment variables that influence systemctl's behavior, including the editor used for unit files and logging configuration.