systemctl commands
systemctl
is the tool you’ll use to manage the services that have been defined on your system. These examples will use the foobar
service, which doesn’t really exist, as a stand-in for whatever service you might be managing.
Checking the status of a service
systemctl status <service>
checks the status of the service. You’ll get an assortment of data that’s useful for all kinds of troubleshooting tasks. This is what the output for the nginx web server’s service looks like:
Figure 3.1: nginx web server service output
Let’s dissect the information that’s displayed in the dense output that this command produces, line by line:
- Service name: The name of the service as defined in its unit file.
- Load state: Whether the service unit file has been successfully loaded and is ready to be started.
- Active state: The current state of the service – whether it is running, inactive...