systemd status=203/EXEC and 217/USER: Exec and Permission Failures
203 is a failed execve, 217 is a user systemd could not resolve. Both happen before your program runs, and the check that finds each takes one command.

Introduction & Quick Summary
Symptom. sudo systemctl start myapp fails immediately, and systemctl status myapp reports Active: failed (Result: exit-code) with Main process exited, code=exited, status=203/EXEC — or the service never starts because Failed to determine user credentials: No such process and status=217/USER. The unit file looks correct, journalctl -u myapp is empty because the process never ran, and testing the command by hand as root works.
Cause. Both codes are reported by systemd before your program runs. 203/EXEC means execve() on the ExecStart binary failed: the path is wrong or relative, the file is not executable, the shebang interpreter does not exist, the mount is noexec, or SELinux refuses the transition. 217/USER means systemd could not resolve the User= or Group= name at the moment of start — a typo, a missing system account, or a directory-service user that is not available yet at boot.
Fix. Resolve the exec path and the identity separately, as the service would. 203/EXEC: use an absolute path, confirm test -x, check the shebang with head -1, and verify the mount options. 217/USER: create the account (useradd --system), or order the unit after nss-user-lookup.target and network-online.target when the user comes from LDAP. systemd-analyze verify myapp.service catches most of both before you restart anything.
Core Mechanics, Signatures & Reproducible Setup
systemd forks, applies sandboxing, switches identity, then calls execve(). Each step has its own exit status, which is why the number in status= tells you exactly which step failed.
ExecStart=/usr/local/bin/myapp --config /etc/myapp/config.yaml
User=myapp
Group=myapp
WorkingDirectory=/var/lib/myappA minimal unit that reproduces both failures on any system:
# /etc/systemd/system/breakme.service
[Unit]
Description=reproducer
[Service]
Type=simple
User=ghostuser
ExecStart=/opt/myapp/run.sh
Restart=no
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload && sudo systemctl start breakme
systemctl status breakme --no-pager # status=217/USER: ghostuser does not exist
sudo useradd --system --no-create-home --shell /usr/sbin/nologin ghostuser
sudo systemctl start breakme
systemctl status breakme --no-pager # status=203/EXEC: /opt/myapp/run.sh missingReproduce it as the service user, which is the check that actually finds permission problems:
sudo -u myapp /opt/myapp/run.sh # prints the real error, e.g. Permission denied
namei -l /opt/myapp/run.sh # every path component needs o+x for the service user
stat -c '%A %U:%G %n' /opt/myapp/run.shKey Comparison Table
systemd exit statuses name the failing step, not the program.
status= | Meaning | Typical cause | Check |
|---|---|---|---|
200/CHDIR | Could not change to WorkingDirectory | Directory missing or unreadable | namei -l $WorkingDirectory |
203/EXEC | execve() failed | Missing, relative, not exec, bad shebang | sudo -u user /abs/path |
216/GROUP | Group not found | Group= typo or missing account | getent group <name> |
217/USER | User not found | User= typo, NSS not ready at boot | getent passwd <name> |
226/NAMESPACE | Sandbox setup failed | ProtectSystem=, PrivateTmp= conflict | systemd-analyze security |
233/RESOURCES | Resource limits refused | MemoryMax= below the runtime floor | systemctl show -p MemoryMax |
1–255 | The program ran and exited | Application error | journalctl -u name -n 50 |
The two failures have almost no overlap in diagnosis:
| Aspect | 203/EXEC | 217/USER |
|---|---|---|
| When it fails | After identity switch, in execve | Before any process starts |
| Journal output | Usually nothing from your app | Failed to determine user credentials |
Affected by chmod | Yes | No |
| Affected by NSS/LDAP | No | Yes |
| Diagnose with | sudo -u <user> <path> | getent passwd <user> |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
1. A script with the wrong interpreter
A relative ExecStart=./run.sh is rejected outright; a script whose shebang names an interpreter that is not installed fails at execve with the same 203:
ExecStart=/opt/myapp/run.sh # absolute, executablehead -1 /opt/myapp/run.sh # #!/usr/bin/env bash -> needs env and bash on PATH#!/usr/bin/env node fails on a minimal image without /usr/bin/env and depends on the PATH systemd gives the unit (a very short default, not your shell's). Name the interpreter explicitly: ExecStart=/usr/bin/node /opt/myapp/server.js.
2. CRLF line endings in the shebang
A file edited on Windows ends its first line with \r, so the kernel looks for an interpreter named /bin/bash\r and reports 203/EXEC (or bad interpreter: /bin/bash^M when run by hand):
file /opt/myapp/run.sh # 'with CRLF line terminators'
sed -i 's/\r$//' /opt/myapp/run.shThe same edit also breaks EnvironmentFile= parsing when a value ends in a carriage return.
3. Permissions on the path, not just the file
test -x /opt/myapp/run.sh passes as root while the service user still cannot execute it, because a parent directory lacks the execute bit. Every component of the path needs o+x (or group access for the service account):
namei -l /opt/myapp/run.sh
# drwxr-x--- root root /opt <- blocks every non-root user
chmod o+x /opt
chmod 750 /opt/myapp && chown -R myapp:myapp /opt/myapp4. noexec mounts and encrypted home directories
A binary on a noexec mount returns 203/EXEC even when everything looks right. This bites deployments under /home, /tmp (often noexec,nosuid) and on network shares:
findmnt -no TARGET,OPTIONS /home /tmp /opt
# /home ext4 rw,noexec,nosuidMove the binary to /usr/local/bin or /opt, or drop noexec from the mount. For an encrypted home that is not mounted at boot, add RequiresMountsFor=/home/myapp so systemd waits for it.
5. Users that exist only after the network is up
Directory-service accounts resolve asynchronously at boot. A unit that starts early fails with 217/USER while getent passwd myapp works interactively minutes later:
[Unit]
After=network-online.target nss-user-lookup.target
Wants=network-online.targetnss-user-lookup.target is the ordering point systemd provides exactly for this. If the host is offline, systemd's own NSS fallback flags (systemd-remount-fs, nss-systemd) can also hide the account until the cache is warm.
6. Sandboxing options that collide with the executable
Hardening can turn a working unit into 203 or 226: ProtectSystem=strict makes /usr read-only (fine) but also hides paths under ReadWritePaths (not); PrivateTmp= gives the service its own /tmp; ProtectHome=true hides /home entirely; NoNewPrivileges= blocks a setuid helper the app spawns.
systemd-analyze verify /etc/systemd/system/myapp.service
systemd-analyze security myapp.service | tail -5
sudo systemctl show myapp -p ProtectHome -p ProtectSystem -p PrivateTmpIf a service worked before hardening was added, revert one directive at a time instead of guessing; the status changes between 203, 226 and a plain application failure depending on which path the option hides.
Common Compilation/Runtime Mistakes & Version Gotchas
- Editing the unit without
daemon-reload. systemd keeps the parsed unit in memory;systemctl daemon-reloadis required after every change, andsystemctl restartalone applies the old version. %inExecStart. systemd expands specifiers, soExecStart=/bin/date +%Yfails; write%%Y. This is one of the few cases where a correct command breaks only under systemd.Environment=with shell quoting.Environment="PATH=/opt/bin:$PATH"does not expand$PATH; expansion happens only for$VARwords inExecStart, and only for variables the unit defines.Restart=alwayshiding the cause. A unit in a restart loop buries the first failure.systemctl reset-failed myappclears the counter, andjournalctl -u myapp -bkeeps the first attempt.Type=forkingwithout a PID file. systemd reports success even when the daemon dies immediately;Type=simpleplusRestart=on-failuresurfaces the crash instead.PermissionsStartOnly=from old guides. It was removed; the modern equivalent is the+prefix on a singleExecStartPre=+/bin/chown …line.- SELinux and AppArmor. A binary in a home directory runs by hand and fails with 203 under systemd because the label is wrong:
ls -Z /opt/myapp, thenrestorecon -Rv /opt/myapp(RHEL family) instead ofsetenforce 0.
Related tools. When two unit versions disagree about a path or an environment block, paste them into the text diff tool to see the difference that matters; when a service fails while reading a JSON config, format it with the JSON formatter and check the file the unit actually points at, since a WorkingDirectory= change quietly changes which relative config gets loaded.
Try matching browser tools
All toolsSmall utilities that fit Linux work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Linux guides
All Linux guidessystemd Timers vs Cron: Missing PATH, Overlapping Runs, Time Drift
Cron runs a bare shell with no profile and no locking, and systemd reads the system time zone. The environment, single-instance and schedule fixes for both.
Bash Indexed Arrays, Associative Maps, and Parameter Expansion
Quoting decides whether an array stays a list, and the expansion operators replace most external text tools. Includes set -u, mapfile, namerefs, and the bash 3.2 differences that break scripts on macOS.
Parsing JSON and YAML in Shell Pipelines with jq and yq
jq is a filter language, not a pretty-printer. The operators that do the work, --arg versus string interpolation, in-place YAML edits, and how to tell which yq is installed before writing a command.
Linux Memory, Swap, the OOM Killer, vmstat, and sysctl Tuning
MemAvailable versus used, the vmstat columns that prove thrashing, how the OOM killer picks its victim, and the sysctl keys that belong in /etc/sysctl.d instead of a one-off command.
More in Linux
All Linux guidesThe guides filed next to this one in Linux, in library order.