How to manage system services on Linux
There are currently 3 main init systems used by linux. A few years ago, there was just one, SysVinit, but it’s been deprecated in most distros by now. Currently, most distros are switching to systemd, for example, Debian Jessie. The most notable distribution using systemd are Fedora, CentOS, RedHat, OpenSuse, Ubuntu, Mint.
I will briefly introduce the whole thing.
Print active services in human-readable form.
# systemctl list-units -t service
Print active services without legend/headers.
# systemctl list-units -t service --no-legend
Print statıus of single service.
# systemctl status cron
Check if the service is active.
# systemctl is-active cron
Enable as a startup service.
# systemctl enable cron
Disable a sartup service.
# systemctl disable cron
Start s service.
# systemctl start cron
Stop a service.
# systemctl stop cron
Reload service’s configuration.
# systemctl reload cron
Restart a service.
# systemctl restart cron
Restart a service if it’s running.
# systemctl try-restart cron
Recent Comments