2025-12-16 10:20:31 -07:00
|
|
|
# systemctl try-restart
|
|
|
|
|
|
|
|
|
|
> Restart one or more units only if they are currently running.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#try-restart%20PATTERN%E2%80%A6>.
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Restart a specific unit if it is running:
|
|
|
|
|
|
|
|
|
|
`systemctl try-restart {{unit}}`
|
|
|
|
|
|
|
|
|
|
- Restart multiple units if they are running:
|
|
|
|
|
|
|
|
|
|
`systemctl try-restart {{unit1 unit2 ...}}`
|
|
|
|
|
|
|
|
|
|
- Restart all units matching a pattern if they are running:
|
|
|
|
|
|
|
|
|
|
`systemctl try-restart '{{pattern}}'`
|