mrsn0.3.0
auth
live

Systemd service not starting: the log already named the cause

Two commands and six journal verdicts: 203/EXEC means path, shebang or exec bit; boot-only failures are ordering races. systemctl status plus journalctl -u the unit -n 50 --no-pager.

2026-11-232 min read

Systemd service not starting is rarely a mystery: the journal named the cause before you touched the unit file.

journal tail
50
lines — journalctl -n 50
privileged port
1024
below it: CAP_NET_BIND_SERVICE
start-rate guard
5
failures in sixty seconds
The error was in the journal the whole time.

Why is the systemd service not starting? Read the log first

systemctl status myapp.servicejournalctl -u myapp.service -n 50 --no-pagerinactive (dead) · failed (exit-code) · activating (auto-restart)systemctl list-units --failedsystemctl reset-failed myapp.service# earlier run: -b for this boot, --since today

status gives state and last lines; the journal gives stdout, stderr and systemd's complaints.

What does each journal verdict mean?

The most likely causes, in order:

Log saysLikely causeFix
status=203/EXECWrong ExecStart= path or missing interpreterAbsolute path, chmod +x, check shebang
status=203/EXEC on a scriptCRLF line endings or bad shebangdos2unix script.sh, fix first line
status=1/FAILURE, no app logWorking directory or env var missingSet WorkingDirectory=, add Environment=
Permission deniedUser can't read files or bind the portFix ownership; ports below 1024 need AmbientCapabilities=CAP_NET_BIND_SERVICE or root
Unit is maskedSomeone ran systemctl masksystemctl unmask myapp.service
Unit file edit "does nothing"Daemon not reloadedsystemctl daemon-reload

The 203/EXEC family

Systemd launches ExecStart= without a shell: no tilde, no PATH, no cd. A terminal-OK script that exits 203 is one of four things: not executable, CRLF endings, dead shebang, relative path.

ExecStart=~/app/run.sh  →  ExecStart=/opt/app/run.sh
ExecStart=run.sh        →  ExecStart=/opt/app/run.sh
chmod +x run.sh && dos2unix run.sh
#!/bin/bash    or    #!/usr/bin/env bash

Starts by hand, dies at boot

Boot-time failure is ordering, not syntax. Declare dependencies:

[Unit]
After=network-online.target postgresql.service
Wants=network-online.target

[Service]
ExecStartPre=/usr/bin/test -f /opt/app/config.toml
Environment="PATH=/opt/app/venv/bin:/usr/bin"
User=appuser
WorkingDirectory=/opt/app

After= orders the start; Wants= brings the dependency up. network-online.target needs its wait service enabled: systemctl is-enabled NetworkManager-wait-online.service.

Nothing in the journal?

  1. StandardOutput= and StandardError= must be journal or journal+console, not null.
  2. The app writes to a log file instead of stdout — systemd captures only stdout/stderr.
  3. Storage caps dropped old lines: journalctl --disk-usage, SystemMaxUse= in /etc/systemd/journald.conf.

The 60-second checklist

  1. systemctl status myapp.service — read the state and last lines.
  2. journalctl -u myapp.service -n 50 --no-pager — find the real error.
  3. 203/EXEC? Fix path, shebang, permissions. Permission denied? Fix user and file ownership.
  4. Fails only at boot? Add After=/Wants=network-online.target and an ExecStartPre= guard.
  5. Change a unit file? systemctl daemon-reload && systemctl restart myapp.service.
  6. Add Restart=on-failure so the next crash announces itself instead of hiding.
restart policies, verbatim
Restart=no (default)        → never
Restart=on-failure          → non-zero exit, signal, timeout
Restart=always              → any exit, even clean
Restart=on-watchdog         → watchdog timeout only
RestartSec=5
StartLimitIntervalSec= / StartLimitBurst=  # five failures in sixty seconds
The law: read the journal before you edit the unit file, then reload and restart. Add Restart=on-failure so the next crash speaks up.
  • tooling: systemd · journalctl · unit files
  • first published 2026-09-14, record refreshed 2026-10-04; the five causes, 203/EXEC mechanics and restart policies are systemd's documented behaviour
  • verify: systemctl list-units --failed → 0 loaded units listed
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt