How do I use the systemctl command to view status of a systemd service on Linux operating systems?
We use systemctl status command under systemd to view the status of the given service on Linux operating systems.
The syntax is as follows for the systemctl command
systemctl status {service-name}
systemctl status {unit-name}
Type:
$ systemctl status nginx.service
## ssh server status ##
$ systemctl status sshd.service
## Lighttpd web server status ##
$ systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-08-04 04:29:19 UTC; 3 weeks 2 days ago
Main PID: 105 (lighttpd)
Tasks: 1 (limit: 115783)
Memory: 56.5M
CGroup: /system.slice/lighttpd.service
└─105 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
Aug 04 04:29:19 utls-bash-wiki systemd[1]: Starting Lighttpd Daemon...
Aug 04 04:29:19 utls-bash-wiki systemd[1]: Started Lighttpd Daemon.
#linux #systemctl