32854f7044
Importing the full environment is convenient, but it doesn't work too well in practice, because we get a metric ton of shell-specific crap that should never end up in the global environment block: $ systemctl --user show-environment ... SHELL=/bin/zsh AUTOJUMP_ERROR_PATH=/home/zbyszek/.local/share/autojump/errors.log AUTOJUMP_SOURCED=1 CONDA_SHLVL=0 CVS_RSH=ssh DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DESKTOP_SESSION=gnome DISPLAY=:0 FPATH=/usr/share/Modules/init/zsh-functions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.8/functions GDMSESSION=gnome GDM_LANG=en_US.UTF-8 GNOME_SETUP_DISPLAY=:1 GUESTFISH_INIT=$'\\e[1;34m' GUESTFISH_OUTPUT=$'\\e[0m' GUESTFISH_PS1=$'\\[\\e[1;32m\\]><fs>\\[\\e[0;31m\\] ' GUESTFISH_RESTORE=$'\\e[0m' HISTCONTROL=ignoredups HISTSIZE=1000 LOADEDMODULES= OLDPWD=/home/zbyszek PWD=/home/zbyszek QTDIR=/usr/lib64/qt-3.3 QTINC=/usr/lib64/qt-3.3/include QTLIB=/usr/lib64/qt-3.3/lib QT_IM_MODULE=ibus SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2612,unix/unix:/tmp/.ICE-unix/2612 SHLVL=0 STEAM_FRAME_FORCE_CLOSE=1 TERM=xterm-256color USERNAME=zbyszek WISECONFIGDIR=/usr/share/wise2/ ... Plenty of shell-specific and terminal-specific stuff that have no global significance. Let's start warning when this is used to push people towards importing only specific variables. Putative NEWS entry: * systemctl import-environment will now emit a warning when called without any arguments (i.e. to import the full environment block of the called program). This command will usually be invoked from a shell, which means that it'll inherit a bunch of variables which are specific to that shell, and usually to the tty the shell is connected to, and don't have any meaning in the global context of the system or user service manager. Instead, only specific variables should be imported into the manager environment block. Similarly, programs which update the manager environment block by directly calling the D-Bus API of the manager, should also push specific variables, and not the full inherited environment. |
||
---|---|---|
.. | ||
systemctl-add-dependency.c | ||
systemctl-add-dependency.h | ||
systemctl-cancel-job.c | ||
systemctl-cancel-job.h | ||
systemctl-clean-or-freeze.c | ||
systemctl-clean-or-freeze.h | ||
systemctl-compat-halt.c | ||
systemctl-compat-halt.h | ||
systemctl-compat-runlevel.c | ||
systemctl-compat-runlevel.h | ||
systemctl-compat-shutdown.c | ||
systemctl-compat-shutdown.h | ||
systemctl-compat-telinit.c | ||
systemctl-compat-telinit.h | ||
systemctl-daemon-reload.c | ||
systemctl-daemon-reload.h | ||
systemctl-edit.c | ||
systemctl-edit.h | ||
systemctl-enable.c | ||
systemctl-enable.h | ||
systemctl-is-active.c | ||
systemctl-is-active.h | ||
systemctl-is-enabled.c | ||
systemctl-is-enabled.h | ||
systemctl-is-system-running.c | ||
systemctl-is-system-running.h | ||
systemctl-kill.c | ||
systemctl-kill.h | ||
systemctl-list-dependencies.c | ||
systemctl-list-dependencies.h | ||
systemctl-list-jobs.c | ||
systemctl-list-jobs.h | ||
systemctl-list-machines.c | ||
systemctl-list-machines.h | ||
systemctl-list-unit-files.c | ||
systemctl-list-unit-files.h | ||
systemctl-list-units.c | ||
systemctl-list-units.h | ||
systemctl-log-setting.c | ||
systemctl-log-setting.h | ||
systemctl-logind.c | ||
systemctl-logind.h | ||
systemctl-preset-all.c | ||
systemctl-preset-all.h | ||
systemctl-reset-failed.c | ||
systemctl-reset-failed.h | ||
systemctl-service-watchdogs.c | ||
systemctl-service-watchdogs.h | ||
systemctl-set-default.c | ||
systemctl-set-default.h | ||
systemctl-set-environment.c | ||
systemctl-set-environment.h | ||
systemctl-set-property.c | ||
systemctl-set-property.h | ||
systemctl-show.c | ||
systemctl-show.h | ||
systemctl-start-special.c | ||
systemctl-start-special.h | ||
systemctl-start-unit.c | ||
systemctl-start-unit.h | ||
systemctl-switch-root.c | ||
systemctl-switch-root.h | ||
systemctl-sysv-compat.c | ||
systemctl-sysv-compat.h | ||
systemctl-trivial-method.c | ||
systemctl-trivial-method.h | ||
systemctl-util.c | ||
systemctl-util.h | ||
systemctl.c | ||
systemctl.h | ||
systemd-sysv-install.SKELETON |