Back to lessons

Linux Survival Basics

Check If a Service Is Active

Full status output is noisy when a script, checklist, or quick human check only needs the current active state.

Command

systemctl is-active nginx

What changed

Nothing changes. systemctl prints a compact state such as active, inactive, failed, or activating.

Danger

safe

When to use it

Use in runbooks, smoke checks, and quick recovery validation after restarting a service.

When not to use it

Do not use it as a replacement for endpoint checks, logs, or dependency checks.

Undo or recovery

No undo needed because the command is read-only.

Expected output

active

demo script

Disposable terminal steps

  1. systemctl is-active nginx
  2. systemctl status nginx --no-pager --lines=30

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ systemctl is-active nginx
active
::exit-code::0
$ systemctl status nginx --no-pager --lines=30
● nginx.service - A high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
     Active: active (running) since Thu 2026-06-25 14:12:10 CDT; 18min ago
   Main PID: 842 (nginx)
      Tasks: 3
     Memory: 12.4M
Jun 25 14:12:10 vps nginx[842]: start worker processes
Jun 25 14:12:11 vps nginx[842]: ready for connections
::exit-code::0

YouTube Short

Quick service state check.

When you only need the current systemd state, skip the full status page. is-active gives a compact answer.

LinkedIn hook

Get a clean yes-or-no service state without the full status page.

Question: What do you pair with systemctl is-active for a real production smoke check?

experiments

A/B tests to run

Metric: save_rate

A: Pitch script-friendly output.

B: Pitch faster human runbook checks.