Checking whether a systemd service is active confirms whether a daemon is currently running and able to serve its expected role. This quick check is useful before a restart, after a boot, during a deployment, or while narrowing down why a dependent application is not responding.
systemctl is-active asks systemd for the unit's current active state and prints a short result such as active or inactive. When a shorter machine-readable check is needed, the --quiet option suppresses text output and relies on the command exit status instead, while systemctl show exposes the separate ActiveState and SubState values for more detail.
Examples below use Ubuntu 24.04 with OpenSSH as the sample service unit, so the commands refer to ssh.service. Other distributions may use a different unit name such as sshd.service, and companion units such as sockets can remain active even after the service unit itself becomes inactive, so checking the exact unit name and reading the detailed status view avoids wrong conclusions.
$ systemctl list-unit-files --type=service 'ssh*' --no-pager --no-legend ssh.service enabled enabled sshd.service alias -
On Ubuntu, OpenSSH commonly uses ssh.service, while many other Linux distributions expose the same daemon as sshd.service.
$ systemctl is-active ssh.service active
The command prints the current active state to standard output unless --quiet is used.
$ systemctl show --property=ActiveState --property=SubState ssh.service ActiveState=active SubState=running
ActiveState reports the broad service state, while SubState shows the more specific runtime condition such as running or dead.
$ systemctl is-active --quiet ssh.service $ echo $? 0
Exit status 0 means the unit is active, while 3 means the unit is not active; current systemd documentation recommends checking the explicit unit state when the numeric code alone is not enough.
$ systemctl status ssh.service --no-pager
○ ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled)
Active: inactive (dead) since Mon 2026-04-13 08:56:39 UTC; 7s ago
Duration: 2min 8.846s
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 204 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Process: 205 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=0/SUCCESS)
Main PID: 205 (code=exited, status=0/SUCCESS)
CPU: 290ms
##### snipped #####
Common systemd active states include active, inactive, activating, deactivating, and failed.
Companion units such as .socket units can stay active while the service unit is inactive, so read the unit name on the Active: line instead of assuming the whole feature is fully stopped or started.