Raspberry Pi How To: Manage Services

A selection of commands to manage services from Raspian/Debian Jessie onwards:

Print active services:

sudo systemctl list-units -t service

Print all services:

sudo systemctl list-units -t service --all

Print status of a single service:

sudo systemctl status cron

Start/Stop/Restart/Reload service:

sudo systemctl start ssh
sudo systemctl stop ssh
sudo systemctl restart ssh
sudo systemctl reload ssh

Enable/Disable service:

sudo systemctl enable ssh
sudo systemctl disable ssh

Help is available via man systemctl

Note: Pre Jessie (e.g. Wheezy) was using "service myservice start", "service myservice stop", "update-rc.d myservice defaults", etc.

Links:

https://blog.sleeplessbeastie.eu/2015/04/27/how-to-manage-system-services-on-debian-jessie/

https://wiki.archlinux.org/index.php/systemd

https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

https://www.freedesktop.org/wiki/Software/systemd/Incompatibilities/

Credit to Milosz Galazka