Linux command
systemctl-import-environment 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Import
systemctl import-environment [VARIABLE]
Example
systemctl import-environment [VAR1 VAR2 ...]
Example
systemctl import-environment [VARIABLE] --user
说明
systemctl import-environment imports environment variables from the current shell session into the systemd service manager's environment. These imported variables become available to all units started by the service manager. This is commonly used with `--user` to pass display-related variables (like DISPLAY, WAYLAND_DISPLAY, or XDG_SESSION_ID) from the login session to user services.
参数
- --user
- Import into user service manager environment
- --system
- Import into system manager environment (default)
FAQ
What is the systemctl-import-environment command used for?
systemctl import-environment imports environment variables from the current shell session into the systemd service manager's environment. These imported variables become available to all units started by the service manager. This is commonly used with `--user` to pass display-related variables (like DISPLAY, WAYLAND_DISPLAY, or XDG_SESSION_ID) from the login session to user services.
How do I run a basic systemctl-import-environment example?
Run `systemctl import-environment [VARIABLE]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --user do in systemctl-import-environment?
Import into user service manager environment