See 'systemctl status rvice' and 'journalctl -xn' for details. If you made an error in your service configuration, you get output like this. Use systemctl status to check the status of your service. $ systemctl start httpdĪgain, no output, unless something went wrong. Like stopping a service, you can start a service with systemctl start. Main PID: 28465 (code=killed, signal=KILL) Process: 28465 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=killed, signal=KILL) The service is “inactive (dead)” and was cleanly shutdown (“code=exited, status=0”).Īlternatively, if you kill -9 a process, it’ll show you that in the systemctl status output. Main PID: 27482 (code=exited, status=0/SUCCESS) Process: 28234 ExecStop=/bin/kill -WINCH $ (code=exited, status=0/SUCCESS) $ systemctl status httpdĪctive: inactive (dead) since Sat 20:53:23 CEST 25s ago
There’s no additional output, you can still use systemctl status to verify the service stopped. You stop a service with the systemctl stop command. The last part of the systemctl status output shows you the last lines of logs from that particular service. rvice - LSB: start and stop MySQLĪctive: active (running) since Fri 20:42:52 CEST 1 weeks 1 days ago In the case of the MariaDB 10.0 service, it’ll just show you the state of the service. In the case of a webserver, it can show you throughput of the HTTP calls. The Status: output isn’t available for every service. Status: "Total requests: 0 Current requests/sec: 0 Current traffic: 0 B/sec" This is the Apache2 webserver, so we’ll see many child processes with Parent ID referring to this Main PID. This one explains itself, the main PID is 27482. It’s actively running and was started 1 week ago.
The Active: output tells you the state of the service. Active: active (running) since Fri 22:26:29 CEST 1 weeks 0 days ago The enabled/disabled at the end tells you if the service is enabled/disabled to start on boot.
Loaded: loaded (/usr/lib/systemd/system/rvice enabled) There’s quite a bit of output in systemctl, so let’s break it down. Loaded: loaded (/usr/lib/systemd/system/rvice enabled)Īctive: active (running) since Fri 22:26:29 CEST 1 weeks 0 days ago To check the state, run systemctl status on your target service. Check the state of the service on CentOS 7
This post will show you how to start or stop a service on a RHEL or CentOS 7 server.