Back to lessons

Linux Survival Basics

Check Whether a Service Starts at Boot

A service is manually started during an incident, but nobody verifies whether systemd will start it after reboot.

Command

systemctl is-enabled nginx

What changed

Nothing changes. systemctl prints enabled, disabled, static, masked, or another enablement state.

Danger

safe

When to use it

Use after installing services, recovering incidents, or manually starting daemons.

When not to use it

Do not use it to check whether the service is currently running; use systemctl is-active for that.

Undo or recovery

No undo needed because the command is read-only.

Expected output

enabled

demo script

Disposable terminal steps

  1. systemctl is-enabled nginx
  2. systemctl is-active nginx

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ systemctl is-enabled nginx
enabled
::exit-code::0
$ systemctl is-active nginx
active
::exit-code::0

YouTube Short

Will this service start after reboot?

A service can be running right now and still not start on the next reboot. Check enablement separately.

LinkedIn hook

Running now does not mean it will survive the next reboot.

Question: Have you ever fixed a service only to lose it on reboot?

experiments

A/B tests to run

Metric: share_rate

A: Running now is not reboot survival.

B: Post-incident validation needs enablement.