← 返回命令列表

Linux command

systemctl-add-wants 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Example

systemctl add-wants [target] [unit]

Example

systemctl add-wants [target] [unit1 unit2 ...]

Example

systemctl add-wants [target] [unit] --user

说明

systemctl add-wants appends `Wants=` dependencies to a specified systemd target for one or more units. A `Wants=` relationship establishes a soft dependency: the target will attempt to start the listed units, but will not fail if they cannot be activated. This command provides a programmatic way to establish unit dependencies without manually editing unit files or creating symlinks in `.wants/` directories. It is commonly used to enable services at specific boot targets.

参数

--system
Operate on system configuration (default)
--user
Operate on user configuration
--runtime
Make temporary changes until reboot
--global
Apply globally for all user logins

FAQ

What is the systemctl-add-wants command used for?

systemctl add-wants appends `Wants=` dependencies to a specified systemd target for one or more units. A `Wants=` relationship establishes a soft dependency: the target will attempt to start the listed units, but will not fail if they cannot be activated. This command provides a programmatic way to establish unit dependencies without manually editing unit files or creating symlinks in `.wants/` directories. It is commonly used to enable services at specific boot targets.

How do I run a basic systemctl-add-wants example?

Run `systemctl add-wants [target] [unit]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --system do in systemctl-add-wants?

Operate on system configuration (default)