Fix a service that will not start on boot

We'll check systemctl enable, status, and journalctl, fix the unit file [Install] and dependencies—or tell you when to escalate.

Category
Troubleshooting · Servers & Linux
Time
10–20 min
Last reviewed
What you'll need
  • SSH or console access with sudo

Step-by-step diagnostic

Step 1 of 7
Show full guide

Steps

Goal: Check systemctl enable, status, and journalctl, then fix the unit file or dependencies.

  • Run systemctl is-enabled servicename. If disabled, run sudo systemctl enable servicename.
  • Good: Service is enabled. Proceed to Check boot logs if it still does not start on boot.
  • Bad: Enable fails—check Fix unit file.

Check enable status

Goal: Confirm the service is enabled for boot.

  • Run systemctl is-enabled servicename. It should return enabled. If disabled, run sudo systemctl enable servicename.
  • If enable fails with “has no [Install] section”, the unit file lacks the [Install] block. Add it via sudo systemctl edit servicename.
  • Good: Service is enabled. Reboot and check status.
  • Bad: Enable fails—add [Install] WantedBy=multi-user.target to the unit.

Check boot logs

Goal: See why the service failed at boot.

  • Run journalctl -u servicename -b --no-pager to read logs from the current boot.
  • Look for dependency failed, permission denied, or timeout. Check systemctl status for any unit listed in After= or Requires=.
  • Good: Error identified. Proceed to Fix unit file.
  • Bad: Logs unclear—check systemctl cat servicename for the full unit.

Fix unit file

Goal: Add [Install] WantedBy and fix dependencies.

  • Run systemctl cat servicename. Confirm [Install] has WantedBy=multi-user.target (or graphical.target for GUI services).
  • If missing, run sudo systemctl edit servicename and add:
    [Install]
    WantedBy=multi-user.target
  • If the service needs network, add After=network-online.target in [Unit]. Run sudo systemctl daemon-reload and sudo systemctl enable servicename.
  • Good: Unit has [Install] and correct dependencies. Reboot and confirm the service starts.
  • Bad: Service still fails—check if a dependency fails at boot.

When to escalate

Escalate if:

  • The service is managed by config management (Puppet, Ansible, Chef).
  • The unit file is from a package you cannot safely modify.
  • Dependencies are outside your control.

Provide systemctl status, journalctl -u servicename -b, and systemctl cat output.

Verification

  • systemctl is-enabled servicename returns enabled.
  • After reboot, systemctl status servicename shows active (running).
  • journalctl -u servicename -b shows no errors for the service.

Escalation ladder

Work from the device outward. Stop when the problem is fixed.

  1. Check enabled systemctl is-enabled; systemctl enable if disabled.
  2. Status and logs systemctl status; journalctl -u servicename -b.
  3. Unit file Add [Install] WantedBy; fix After/Requires dependencies.
  4. Escalate Provide status, journalctl, unit file.

What to capture if you need help

Before calling support or posting for help, have these ready. It speeds everything up.

  • systemctl is-enabled output
  • systemctl status output
  • journalctl -u servicename -b output
  • systemctl cat servicename (unit file)
  • Steps already tried

Is the service enabled?

Run systemctl is-enabled servicename.

Run `systemctl is-enabled servicename`. Disabled: run `sudo systemctl enable servicename`, reboot, test. Enabled: the unit may lack [Install] or a dependency fails—check journalctl -u servicename -b.

You can change your answer later.

Enable the service

Run `sudo systemctl enable servicename`. If it fails with "has no [Install]", add [Install] WantedBy=multi-user.target via systemctl edit. Run daemon-reload, enable again. Reboot and check status.

What does journalctl -b show?

Read boot-time logs for the service.

Run `journalctl -u servicename -b --no-pager`. Dependency failed: check systemctl status for the dependency. Permission denied: fix chown/chmod. No [Install]: add WantedBy. Other: check unit file and dependencies.

You can change your answer later.

Check unit file

Run `systemctl cat servicename`. Confirm [Install] WantedBy exists. Check After= and Requires=. Add After=network-online.target if the service needs network. systemctl daemon-reload; reboot; check status.

Apply fix

No [Install]: systemctl edit, add [Install] WantedBy=multi-user.target. Dependency: fix or start the dependency. Masked: systemctl unmask. daemon-reload, enable, reboot. Confirm you should see the service active after reboot.

You can change your answer later.

Done

Service starts on boot. Monitor with systemctl status after reboot.

Escalate

Provide systemctl status, journalctl -u servicename -b, and systemctl cat. Escalate if config management or packaged unit.

Reviewed by Blackbox Atlas

Frequently asked questions

Why would a service not start on boot?
The service is not enabled (systemctl enable), the unit file lacks [Install] with WantedBy, or a dependency fails at boot. Check systemctl is-enabled and journalctl.
Can I fix a service that will not start on boot myself?
Yes. Run systemctl enable servicename, confirm the unit has [Install] WantedBy, and check journalctl for dependency or timing errors.
When should I escalate boot start failures?
If the service is managed by config management, the fix requires changes to packaged unit files, or dependencies are outside your control.

Rate this guide

Was this helpful?

Thanks for your feedback.

Continue to