Linux command
systemctl-preset 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
systemctl preset [unit1 unit2 ...]
Enable
systemctl preset [unit] --preset-mode enable-only
Disable
systemctl preset [unit] --preset-mode disable-only
Quiet
systemctl preset [unit] -q
说明
systemctl preset resets the enablement state of specified unit files to the defaults defined in preset policy files. Preset files in `/usr/lib/systemd/system-preset/` and `/etc/systemd/system-preset/` define which units should be enabled or disabled by default. This is typically used after package installation to set the initial enablement state according to distribution policy.
参数
- --preset-mode= _MODE_
- full (default), enable-only, or disable-only
- -q, --quiet
- Suppress output, return only exit code
- --user
- Operate on user units
FAQ
What is the systemctl-preset command used for?
systemctl preset resets the enablement state of specified unit files to the defaults defined in preset policy files. Preset files in `/usr/lib/systemd/system-preset/` and `/etc/systemd/system-preset/` define which units should be enabled or disabled by default. This is typically used after package installation to set the initial enablement state according to distribution policy.
How do I run a basic systemctl-preset example?
Run `systemctl preset [unit1 unit2 ...]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --preset-mode= _MODE_ do in systemctl-preset?
full (default), enable-only, or disable-only