What functions does the systemctl command offer in Linux?
The systemctl command is a tool used to manage systemd systems and services. It has the following functions:
- Start, stop, and restart a service using systemctl: systemctl start/stop/restart service_name.
- Check the status of the service: systemctl status service_name
- Enable/disable a service to start on boot: systemctl enable/disable service_name
- Check if the service is set to automatically start on boot: systemctl is-enabled service_name
- Check the service logs: systemctl status service_name or journalctl -u service_name
- List the status of all services: systemctl list-units
- Check the list of enabled services: systemctl list-unit-files
- List the services that the service depends on: systemctl show -p Requires service_name
- Check the detailed information of the service by using: systemctl show service_name
- To view detailed information about an enabled service, use the command: systemctl show –all service_name
In addition to the functions mentioned above, systemctl can also manage the system’s targets (similar to traditional runlevels), control service resource limits, and other advanced functions.