Learn what the systemd status 203/EXEC error means and how to fix it by checking the ExecStart path, permissions, shebang lines and SELinux context. Includes practical journalctl and systemctl commands for Ubuntu, Debian, AlmaLinux and Rocky.
Prerequisites
- Root or sudo access to the server
- A systemd unit file that is failing to start
- Basic familiarity with the command line
What this solves
When a systemd service fails with status 203/EXEC, systemd was unable to execute the binary or script defined in your unit file. This is almost always caused by a wrong path, missing execute permission, a bad shebang line, or an SELinux context blocking execution.
This tutorial walks through diagnosing the exact cause with journalctl and systemctl, then applying the correct fix without resorting to unsafe permission changes.
Understanding the 203/EXEC exit code
systemd exit codes follow a standard convention. Codes in the 200 range mean systemd could not even start the process, as opposed to the process starting and then crashing (which would show a different exit code).
| Exit code | Meaning |
|---|---|
| 203/EXEC | systemd could not execute the command in ExecStart. The file is missing, not executable, or the interpreter failed |
| 200/CHDIR | The WorkingDirectory specified does not exist |
| 126 | Command found but not executable (shell-level equivalent) |
| 127 | Command not found (shell-level equivalent) |
203/EXEC specifically means the kernel's execve() call failed when systemd tried to launch your process. The four most common root causes are a typo in the binary path, a missing execute bit, a missing or broken shebang line in a script, or an SELinux policy denial.
Step-by-step diagnosis and fix
Check the failed service status
Start by looking at the immediate error systemd reports. This confirms you are dealing with 203/EXEC and not a different failure mode.
sudo systemctl status myapp.serviceYou should see output similar to this in the status block.
Process: 48213 ExecStart=/opt/myapp/start.sh (code=exited, status=203/EXEC)Read the full unit file
Use systemctl cat to see the exact unit file systemd is actually using, including any drop-in overrides in /etc/systemd/system/myapp.service.d/. This avoids editing the wrong file.
sudo systemctl cat myapp.servicePay close attention to the ExecStart line, the User directive, and WorkingDirectory. A typo in any of these can trigger 203/EXEC.
Check detailed logs with journalctl
journalctl -xe gives extended context around the failure, including kernel-level denial messages that systemctl status truncates.
sudo journalctl -xe -u myapp.serviceFor a focused view of just the last failed attempt, use the boot-relative flag.
sudo journalctl -u myapp.service --since "10 minutes ago" --no-pagerPermission denied alongside 203/EXEC on AlmaLinux or Rocky, suspect SELinux before anything else. Continue to the SELinux step below.Verify the ExecStart path actually exists
A very common cause is a path that is slightly wrong, for example a typo, a relative path where systemd needs an absolute one, or a binary that was moved or never installed in the expected location.
sudo systemctl cat myapp.service | grep ExecStartTake the path from ExecStart and confirm it exists on disk.
ls -l /opt/myapp/start.shIf the file does not exist at that exact path, fix the ExecStart line in the unit file to point to the correct absolute path. systemd does not search your shell's PATH, so relative commands like start.sh without a full path will fail.
[Unit]
Description=My application
After=network.target
[Service]
Type=simple
User=myapp
WorkingDirectory=/opt/myapp
ExecStart=/opt/myapp/start.sh
Restart=on-failure
[Install]
WantedBy=multi-user.targetFix the execute bit with chmod
Linux file permissions are split into three groups: owner, group, and others, each with read (r), write (w) and execute (x) permissions. A script without the execute bit set cannot be run directly, even if the content is a valid shell script.
Check the current permissions first.
ls -l /opt/myapp/start.shIf the output looks like -rw-r--r--, the execute bit is missing for everyone, including the owner. Add execute permission for the owner and group that need to run it.
sudo chmod 750 /opt/myapp/start.sh750 means the owner gets read, write and execute (7), the group gets read and execute (5), and others get nothing (0). This is appropriate for an application script that only the service account and its group need to run.
If the service runs as a dedicated application user, make sure that user actually owns the file or has group access.
sudo chown myapp:myapp /opt/myapp/start.shFor deeper background on the permission model, see configure Linux file and directory ownership with chown and security best practices.
Check for a missing or broken shebang line
If ExecStart points to a script (not a compiled binary), the first line must be a valid shebang telling the kernel which interpreter to use. A missing shebang, a typo in the interpreter path, or Windows-style line endings (CRLF) will all cause 203/EXEC.
head -n 1 /opt/myapp/start.shA correct shebang for a bash script looks like this at the very top of the file.
#!/bin/bash
cd /opt/myapp
exec /usr/bin/python3 app.pyConfirm the interpreter actually exists at that path.
which bash
which python3If the script was edited on Windows, strip carriage returns that break the shebang line.
sudo sed -i 's/\r$//' /opt/myapp/start.shDiagnose SELinux context issues on AlmaLinux and Rocky
On RHEL-based systems, SELinux can block execution even when standard Unix permissions are correct. This is the most common 203/EXEC cause after a file was copied from another location or restored from a backup, since it may carry the wrong SELinux label.
sudo ausearch -m avc -ts recentLook for a denied message referencing your binary path and an execute permission. If you see one, the file has an incorrect SELinux context rather than a permissions problem.
ls -lZ /opt/myapp/start.shCompare the context shown against what is expected for executables in that location, then restore the correct default context.
sudo restorecon -v /opt/myapp/start.shIf the application lives in a non-standard directory, define a persistent file context rule instead of repeatedly running restorecon after every deployment.
sudo semanage fcontext -a -t bin_t "/opt/myapp/start.sh"
sudo restorecon -v /opt/myapp/start.shsetenforce 0 to work around this. Fix the context with restorecon or semanage so the security policy stays enforced. For a deeper walkthrough, see configure SELinux mandatory access controls for enhanced security.Reload systemd and restart the service
After editing the unit file, fixing permissions, or restoring the SELinux context, systemd needs to reload its configuration cache before the fix takes effect.
sudo systemctl daemon-reload
sudo systemctl restart myapp.servicedaemon-reload is only required when the unit file itself changed. It is harmless to run it anyway whenever you are troubleshooting, since it has no effect on running services.
Verify your setup
Confirm the service is active and check the most recent log entries to ensure it stayed running rather than failing silently again.
sudo systemctl status myapp.service
sudo journalctl -u myapp.service -n 30 --no-pagerA healthy result shows Active: active (running) with no repeated restart attempts in the log. If you manage several services on the same host, cross-check with a full service list.
systemctl list-units --type=service --state=failedFor general service management commands beyond this fix, see check and manage running services on Linux with systemctl.
Common issues
| Symptom | Cause | Fix |
|---|---|---|
| status=203/EXEC immediately on start | ExecStart path is wrong or relative | Use an absolute path and confirm the file exists with ls -l |
| Script runs fine manually but fails under systemd | Missing execute bit on the script | sudo chmod 750 /path/to/script.sh plus correct ownership with chown |
| 203/EXEC only after restoring from backup on AlmaLinux | Wrong SELinux context on the restored file | sudo restorecon -v /path/to/file |
| Shebang line looks correct but still fails | Windows line endings (CRLF) in the script | sudo sed -i 's/\r$//' /path/to/script.sh |
| Interpreter not found error in logs | Shebang points to a path that does not exist on this system | Run which bash or which python3 and update the shebang line |
| Works as root but fails under systemd's configured User | Service account lacks execute permission or directory traversal rights | Grant group execute with chmod and verify parent directories are at least 711 |
Next steps
- Check and manage running services on Linux with systemctl
- Configure Linux file and directory ownership with chown and security best practices
- Configure SELinux mandatory access controls for enhanced security
- Fix systemd service keeps restarting in a loop
- Configure systemd service resource limits and security isolation