← 返回命令列表

Linux command

systemctl-reenable 命令

文本

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

常用示例

Re-enable

systemctl reenable [unit]

Example

systemctl reenable [unit1 unit2 ...]

Example

systemctl reenable [unit] --now

说明

systemctl reenable is equivalent to running `disable` followed by `enable`. It removes all existing symlinks for the unit and recreates them according to the current Install section in the unit file. This is useful when a unit's Install section has changed (e.g., the targets it should be enabled for), as `enable` alone won't update existing symlinks.

参数

--now
Also start the unit after re-enabling
--user
Operate on user units

FAQ

What is the systemctl-reenable command used for?

systemctl reenable is equivalent to running `disable` followed by `enable`. It removes all existing symlinks for the unit and recreates them according to the current Install section in the unit file. This is useful when a unit's Install section has changed (e.g., the targets it should be enabled for), as `enable` alone won't update existing symlinks.

How do I run a basic systemctl-reenable example?

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

What does --now do in systemctl-reenable?

Also start the unit after re-enabling