Home Explore Blog CI



man-pages

16th chunk of `systemctl.man`
8c79559a1e9a15568412b8195e7d38fcdff6b4dc8d4b46be0000000100000fa8
 cancel all pending jobs.

   Environment Commands
       systemd supports an environment block that is passed to processes the manager spawns. The names of the variables can contain ASCII letters, digits, and the underscore character. Variable names cannot be empty or start
       with a digit. In variable values, most characters are allowed, but the whole sequence must be valid UTF-8. (Note that control characters like newline (NL), tab (TAB), or the escape character (ESC), are valid ASCII and
       thus valid UTF-8). The total length of the environment block is limited to _SC_ARG_MAX value defined by sysconf(3).

       show-environment
           Dump the systemd manager environment block. This is the environment block that is passed to all processes the manager spawns. The environment block will be dumped in straightforward form suitable for sourcing into
           most shells. If no special characters or whitespace is present in the variable values, no escaping is performed, and the assignments have the form "VARIABLE=value". If whitespace or characters which have special
           meaning to the shell are present, dollar-single-quote escaping is used, and assignments have the form "VARIABLE=$'value'". This syntax is known to be supported by bash(1), zsh(1), ksh(1), and busybox(1)'s ash(1),
           but not dash(1) or fish(1).

       set-environment VARIABLE=VALUE...
           Set one or more systemd manager environment variables, as specified on the command line. This command will fail if variable names and values do not conform to the rules listed above.

       unset-environment VARIABLE...
           Unset one or more systemd manager environment variables. If only a variable name is specified, it will be removed regardless of its value. If a variable and a value are specified, the variable is only removed if
           it has the specified value.

       import-environment VARIABLE...
           Import all, one or more environment variables set on the client into the systemd manager environment block. If a list of environment variable names is passed, client-side values are then imported into the
           manager's environment block. If any names are not valid environment variable names or have invalid values according to the rules described above, an error is raised. If no arguments are passed, the entire
           environment block inherited by the systemctl process is imported. In this mode, any inherited invalid environment variables are quietly ignored.

           Importing of the full inherited environment block (calling this command without any arguments) is deprecated. A shell will set dozens of variables which only make sense locally and are only meant for processes
           which are descendants of the shell. Such variables in the global environment block are confusing to other processes.

   Manager State Commands
       daemon-reload
           Reload the systemd manager configuration. This will rerun all generators (see systemd.generator(7)), reload all unit files, and recreate the entire dependency tree. While the daemon is being reloaded, all sockets
           systemd listens on behalf of user configuration will stay accessible.

           This command should not be confused with the reload command.

       daemon-reexec
           Reexecute the systemd manager. This will serialize the manager state, reexecute the process and deserialize the state again. This command is of little use except for debugging and package upgrades. Sometimes, it
           might be helpful as a heavy-weight daemon-reload. While the daemon is being reexecuted, all sockets systemd listening on behalf of user configuration will stay accessible.

       log-level [LEVEL]
           If no argument is given, print the current log level of the manager. If an optional argument LEVEL is provided, then the command changes the current log level of the manager to LEVEL (accepts the same values as
           --log-level= described

Title: systemctl: Environment and Manager State Commands
Summary
This section describes `systemctl` commands for managing the systemd environment block. It covers `show-environment` (displaying the environment), `set-environment` (setting variables), `unset-environment` (removing variables), and `import-environment` (importing from the client). Additionally, it details commands for managing the systemd manager state: `daemon-reload` (reloading configuration), `daemon-reexec` (re-executing the manager), and `log-level` (managing log level).