LinuxCommandLibrary

systemctl-reload-or-try-restart

TLDR

View documentation for the original command

$ tldr systemctl try-reload-or-restart
copy

SYNOPSIS

systemctl reload-or-try-restart [OPTIONS...] UNIT...

PARAMETERS

--quiet, -q
    Suppress most output; only errors are shown.

--no-pager
    Send output directly to the terminal, bypassing any pager.

--no-legend
    Do not print column headers in tabular output.

--system
    Talk to the system manager (default).

--user
    Talk to the user manager instead of the system manager.

--runtime
    Make changes only in the runtime configuration, not on disk.

--ignore-dependencies
    Do not respect unit dependencies when performing the operation.

--ignore-requirements
    Do not check requirement dependencies.

--no-block
    Do not wait for the operation to finish; return immediately.

DESCRIPTION

The systemctl reload-or-try-restart sub‑command is part of the systemd suite. It attempts to reload the specified unit(s) – sending the unit’s configured ExecReload command – if the unit reports that it supports reloading. If the unit does not implement a reload operation, the command falls back to a full restart (stop then start). Unlike systemctl try-restart, this variant does nothing when the unit is not currently active; it will not start a stopped unit. The command is useful in scripts or administrative workflows where the administrator is unsure whether a service can reload its configuration safely, allowing a single call to handle both cases without causing unnecessary downtime. It was introduced in systemd version 229 to provide a more convenient “reload‑or‑restart‑if‑running” behaviour that mirrors the traditional SysV force-reload action.

CAVEATS

Only units that define an ExecReload command can be reloaded; otherwise the command will restart them. If a unit is inactive, reload-or-try-restart will do nothing – it will not start the unit. Some services ignore reload requests even when they claim to support it, so a restart may still be required.

WHEN TO USE

Use systemctl reload-or-try-restart when you want to apply configuration changes with minimal disruption, but you are not certain whether the service supports a true reload. It is ideal for automated deployment pipelines where a single command should handle both scenarios without manual checks.

DIFFERENCE FROM SIMILAR COMMANDS

systemctl reload-or-restart will start the unit if it is not running, while systemctl reload-or-try-restart will only act on units that are already active. systemctl try-restart never attempts a reload; it simply restarts running units.

HISTORY

The reload-or-try-restart sub‑command was added in systemd version 229 (released in 2016) to provide a SysV‑compatible force-reload behaviour. It complements earlier commands such as reload-or-restart (which also starts stopped units) and try-restart (which only restarts running units). Since its introduction it has been widely adopted in service management scripts and documentation for services that may or may not support live reloading.

SEE ALSO

Copied to clipboard