Interview Prep/Linux/systemd services and journald

A service fails with `status=200/CHDIR`.

BeginnerTroubleshootingsystemd services and journald
Answer

Likely causes → WorkingDirectory= doesn't exist or the service user can't enter it.

Diagnose →

systemctl cat myapp | grep WorkingDirectory
sudo -u appuser test -x /opt/myapp && echo ok
namei -l /opt/myapp

Fix → Create the directory with correct ownership, fix parent permissions, or prefix with - (WorkingDirectory=-/opt/myapp) to make it optional.

Prevent → Use StateDirectory= / RuntimeDirectory= so systemd creates directories with the right owner.

All Linux questions Roadmap: Linux

More on systemd services and journald