0% found this document useful (0 votes)
61 views6 pages

Systemctl Cheatsheet

The document provides a guide on managing services using systemctl commands in Linux. It includes commands for checking service status, starting, stopping, enabling, disabling, and troubleshooting services. Examples are given for specific services like nginx, Docker, and SSH.

Uploaded by

Collins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views6 pages

Systemctl Cheatsheet

The document provides a guide on managing services using systemctl commands in Linux. It includes commands for checking service status, starting, stopping, enabling, disabling, and troubleshooting services. Examples are given for specific services like nginx, Docker, and SSH.

Uploaded by

Collins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

SERVICE STATUS

Task Command

Check if a service is
sudo systemctl status <service>
running

Check if service is enabled systemctl is-enabled <service>

View logs for a service journalctl -u <service>


START / STOP / RESTART

Task Command

Start a service sudo systemctl start <service>

Stop a service sudo systemctl stop <service>

Restart a service sudo systemctl restart <service>

Reload config (no restart) sudo systemctl reload <service>


ENABLE / DISABLE

Task Command

Enable at boot sudo systemctl enable <service>

sudo systemctl disable


Disable at boot
<service>

sudo systemctl reenable


Re-enable after changes
<service>
CLEANUP & TROUBLESHOOTING

Task Command

Show all failed services systemctl --failed

Reset failed services sudo systemctl reset-failed

systemctl list-units --
List all active services
type=service
Examples

Check status of nginx:


sudo systemctl status nginx

Start Docker and enable it at boot:


sudo systemctl start docker
sudo systemctl enable docker

Restart SSH:
sudo systemctl restart ssh

View recent logs from mysql:


journalctl -u mysql

You might also like