tldr/pages/linux/systemctl.md

37 lines
873 B
Markdown
Raw Normal View History

2014-02-25 02:06:23 +00:00
# systemctl
> Control the systemd system and service manager.
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html>.
2014-02-25 02:06:23 +00:00
- Show all running services:
`systemctl status`
- List failed units:
2014-02-25 02:06:23 +00:00
`systemctl --failed`
- Start/Stop/Restart/Reload/Show the status a service:
2014-02-25 02:06:23 +00:00
`systemctl {{start|stop|restart|reload|status}} {{unit}}`
2014-02-25 02:06:23 +00:00
- Enable/Disable a unit to be started on bootup:
2014-02-25 02:06:23 +00:00
`systemctl {{enable|disable}} {{unit}}`
2014-02-25 02:06:23 +00:00
- Reload systemd, scan for new or changed units:
`systemctl daemon-reload`
- Check if a unit is active/enabled/failed:
`systemctl {{is-active|is-enabled|is-failed}} {{unit}}`
2014-02-25 02:06:23 +00:00
- List all service/socket/automount units filtering by running/failed state:
`systemctl list-units --type={{service|socket|automount}} --state={{failed|running}}`
- Show the contents & absolute path of a unit file:
`systemctl cat {{unit}}`