LinuxCommandLibrary

systemctl-try-reload-or-restart

Reload or restart running units only

TLDR

Reload or restart unit (if running)
$ systemctl try-reload-or-restart [unit]
copy
Reload or restart multiple units
$ systemctl try-reload-or-restart [unit1 unit2 ...]
copy
Reload or restart by pattern
$ systemctl try-reload-or-restart '[pattern]'
copy

SYNOPSIS

systemctl try-reload-or-restart PATTERN...

DESCRIPTION

systemctl try-reload-or-restart attempts to reload configuration for running units if they support reloading, otherwise restarts them. Unlike `reload-or-restart`, this command only affects units that are currently active.
If a unit is not running, no action is taken. This is useful for applying configuration changes without starting stopped services.

ALIASES

This command has several aliases: `condreload`, `force-reload`, `reload-or-try-restart`.

CAVEATS

Does nothing for inactive units. Reload only works if the unit has ExecReload defined. If reload isn't supported, the unit is restarted.

HISTORY

The try-reload-or-restart subcommand provides the safest way to apply configuration changes to services, avoiding unintended service starts.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard