Interview Prep/Linux/systemd services and journald

`systemctl status myapp` shows `Main process exited, code=exited, status=203/EXEC`.

BeginnerTroubleshootingsystemd services and journald
Answer

Likely causes → systemd couldn't execute ExecStart: wrong path, file not executable, missing shebang or interpreter, CRLF line endings, noexec mount, or SELinux blocking execution (e.g. a binary in a home directory).

Diagnose →

systemctl cat myapp | grep ExecStart
ls -l /opt/myapp/bin/start.sh
head -1 /opt/myapp/bin/start.sh | cat -A
findmnt -no OPTIONS --target /opt/myapp/bin/start.sh
sudo ausearch -m AVC -ts recent | grep start.sh

Fix → Use an absolute path, chmod +x, add a correct shebang, convert line endings, move it off noexec mounts, or restorecon -v the file. Then systemctl daemon-reload && systemctl restart myapp.

Prevent → Test units in CI or staging; keep service binaries under /opt or /usr/local/bin.

All Linux questions Roadmap: Linux

More on systemd services and journald