Skip to content

Instantly share code, notes, and snippets.

@ali2077
Forked from adriacidre/systemctl.md
Created January 30, 2019 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ali2077/f9a9016588e4cb0e3916958783798da6 to your computer and use it in GitHub Desktop.
Save ali2077/f9a9016588e4cb0e3916958783798da6 to your computer and use it in GitHub Desktop.
Systemctl Cheatsheet

Service Management

Starting and Stopping Services

Starting

sudo systemctl start application.service

or simply

sudo systemctl start application

Stopping

sudo systemctl stop application.service

Restarting and Reloading

sudo systemctl restart application.service

If the application in question is able to reload its configuration files (without restarting), you can issue the reload command to initiate that process:

sudo systemctl reload application.service

Enabling and Disabling Services

The above commands are useful for starting or stopping commands during the current session.

sudo systemctl enable application.service
sudo systemctl disable application.service

Checking the Status of Services

systemctl status application.service
systemctl is-active application.service
systemctl is-enabled application.service
systemctl is-failed application.service

Verify a service file

sudo systemd-analyze verify application.service

Following the logs dor those services

sudo journalctl -u application.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment