CertGrid CertGrid
Hands-on Lab·CompTIA Linux+

A service that will not start

A unit is written, and then broken four ways on purpose: a file that is not executable, a port already in use, a working directory that does not exist, and a program that fails faster than systemd will restart it. Each produces a different exit code in systemctl status, and the page begins with a start command that returned success for a service that had already failed.

Troubleshooting Guide 27 of 28 Intermediate

One host. Every unit created here is named `xk0*`, lives in `/etc/systemd/system`, and is removed at the end.
Server NameIP AddressOSRolesCPURAMHDD
LPLUS-B01192.168.0.74AlmaLinux 10.2RPM-family host - dnf, firewalld, NetworkManager, SELinux2 Core4 GB50 GB

This guide includes

Use this when a service will not come up and the status output is a wall of green and red that does not obviously say why. This matters because the four causes here cover most real failures, and because the command you would naturally trust - systemctl start - returns zero for at least two of them.

Before you start

  1. A unit that will not start

  2. One bit, and what active actually proves

  3. A port that is already taken

  4. A working directory that is not there

  5. A service that fails faster than systemd will restart it

  6. Catching it before it ever starts

  7. Putting the machine back

Official sources