2014-02-25 02:06:23 +00:00
|
|
|
# systemctl
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Control the systemd system and service manager.
|
2020-09-01 15:31:47 +01:00
|
|
|
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html>.
|
2014-02-25 02:06:23 +00:00
|
|
|
|
2021-10-09 03:00:29 +01:00
|
|
|
- Show all running services:
|
|
|
|
|
|
|
|
`systemctl status`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List failed units:
|
2014-02-25 02:06:23 +00:00
|
|
|
|
|
|
|
`systemctl --failed`
|
|
|
|
|
2016-04-09 23:36:11 +01:00
|
|
|
- Start/Stop/Restart/Reload a service:
|
2014-02-25 02:06:23 +00:00
|
|
|
|
2021-02-19 10:13:45 +00:00
|
|
|
`systemctl {{start|stop|restart|reload}} {{unit}}`
|
2014-02-25 02:06:23 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Show the status of a unit:
|
2014-02-25 02:06:23 +00:00
|
|
|
|
|
|
|
`systemctl status {{unit}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Enable/Disable a unit to be started on bootup:
|
2014-02-25 02:06:23 +00:00
|
|
|
|
2021-02-19 10:13:45 +00:00
|
|
|
`systemctl {{enable|disable}} {{unit}}`
|
2014-02-25 02:06:23 +00:00
|
|
|
|
2021-02-21 02:00:15 +00:00
|
|
|
- Mask/Unmask a unit to prevent enablement and manual activation:
|
2016-04-09 23:36:11 +01:00
|
|
|
|
2021-02-19 10:13:45 +00:00
|
|
|
`systemctl {{mask|unmask}} {{unit}}`
|
2016-04-09 23:36:11 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Reload systemd, scanning for new or changed units:
|
2014-02-25 02:06:23 +00:00
|
|
|
|
|
|
|
`systemctl daemon-reload`
|
2020-09-01 15:31:47 +01:00
|
|
|
|
|
|
|
- Check if a unit is enabled:
|
|
|
|
|
|
|
|
`systemctl is-enabled {{unit}}`
|