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.
Systemd service not starting is rarely a mystery: the journal named the cause before you touched the unit file.
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 says | Likely cause | Fix |
|---|---|---|
status=203/EXEC | Wrong ExecStart= path or missing interpreter | Absolute path, chmod +x, check shebang |
status=203/EXEC on a script | CRLF line endings or bad shebang | dos2unix script.sh, fix first line |
status=1/FAILURE, no app log | Working directory or env var missing | Set WorkingDirectory=, add Environment= |
Permission denied | User can't read files or bind the port | Fix ownership; ports below 1024 need AmbientCapabilities=CAP_NET_BIND_SERVICE or root |
Unit is masked | Someone ran systemctl mask | systemctl unmask myapp.service |
| Unit file edit "does nothing" | Daemon not reloaded | systemctl 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?
StandardOutput=andStandardError=must bejournalorjournal+console, notnull.- The app writes to a log file instead of stdout — systemd captures only stdout/stderr.
- Storage caps dropped old lines:
journalctl --disk-usage,SystemMaxUse=in/etc/systemd/journald.conf.
The 60-second checklist
systemctl status myapp.service— read the state and last lines.journalctl -u myapp.service -n 50 --no-pager— find the real error.203/EXEC? Fix path, shebang, permissions.Permission denied? Fix user and file ownership.- Fails only at boot? Add
After=/Wants=network-online.targetand anExecStartPre=guard. - Change a unit file?
systemctl daemon-reload && systemctl restart myapp.service. - Add
Restart=on-failureso 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
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