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

DevOps & Software & Architect & Linux Geek — http://baturorkun.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store