← 返回命令列表

Linux command

systemctl-reload-or-restart 命令

文件

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

常用示例

Reload or restart

systemctl reload-or-restart [unit]

Example

systemctl reload-or-restart [pattern]

Async

systemctl reload-or-restart [unit] --no-block

Example

systemctl reload-or-restart [unit] --user

说明

systemctl reload-or-restart reloads one or more units if they support it. If not, it stops and then starts them instead. If the units are not running yet, they will be started. This is useful for applying configuration changes when you don't know whether a service supports hot reloading. If the unit has `ExecReload=` defined, configuration is reloaded without interrupting the service. Otherwise, the unit is stopped and started again.

参数

--no-block
Return immediately without waiting
--user
Operate on user units

FAQ

What is the systemctl-reload-or-restart command used for?

systemctl reload-or-restart reloads one or more units if they support it. If not, it stops and then starts them instead. If the units are not running yet, they will be started. This is useful for applying configuration changes when you don't know whether a service supports hot reloading. If the unit has `ExecReload=` defined, configuration is reloaded without interrupting the service. Otherwise, the unit is stopped and started again.

How do I run a basic systemctl-reload-or-restart example?

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

What does --no-block do in systemctl-reload-or-restart?

Return immediately without waiting