The systemctl command is a powerful tool in the systemd init system, which provides more than just service launching capabilities. Its extensive documentation, spanning over 1600 lines, highlights its features as a management tool.
To identify if your distribution uses systemd or SystemV init, use the stat command to check the init file. In Ubuntu, for instance, /sbin/init points to the /lib/systemd/systemd file, indicating that it’s a systemd-based distribution.
Services are defined in unit files, and systemctl offers various options to list services, such as –type=service or –all. The display includes active services only, while including –state option allows filtering by running, stopped, enabled, disabled, or failed states.
To check if a service is enabled, use the is-enabled command. To start a service, use the start command followed by the service name, and to stop it, use the stop command. The restart command starts and stops the service simultaneously. Enabling a service flags it to start at boot time, while disabling removes this flag.
Another useful tool within systemd is journalctl, which allows viewing entries related to specific services since a specified time. By utilizing the systemctl command, you can gain deeper insights into your Linux distribution’s inner workings for daily management and troubleshooting purposes.
Source: https://www.howtogeek.com/these-12-systemctl-commands-will-let-you-take-control-of-linux-systemd-services