LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

systemctl-try-restart

Restart units only if running

TLDR

Restart unit if running
$ systemctl try-restart [unit]
copy
Restart multiple units if running
$ systemctl try-restart [unit1 unit2 ...]
copy
Restart by pattern if running
$ systemctl try-restart '[pattern]'
copy

SYNOPSIS

systemctl try-restart PATTERN...

DESCRIPTION

systemctl try-restart restarts one or more units only if they are currently running. If a unit is not active, no action is taken.This is useful for restarting services after configuration changes without accidentally starting services that were intentionally stopped.

ALIASES

This command is also known as `condrestart`.

CAVEATS

Does nothing for inactive units. Unlike `restart`, this won't start a stopped service. For units not currently running, the command succeeds without action.

HISTORY

The try-restart subcommand provides safe restart operations that respect the current service state, avoiding unintended service starts.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid