systemd

Main process exited, code=exited, status=203/EXEC: causes and fix

systemd could not run your service's ExecStart program. Find the cause (path, permissions, shebang, SELinux) and fix status=203/EXEC step by step.

Main process exited, code=exited, status=203/EXEC

In short

systemd reported this error when it tried to start a service and the kernel could not execute the program named in ExecStart. Status 203/EXEC means the exec call failed, so the program never ran. The usual reasons are a wrong path, a missing execute bit, a bad shebang line, a wrong-architecture binary, or a security policy blocking it.

Likely causes

  • •The ExecStart path is wrong or the file does not exist. Typos, or a binary installed somewhere else, are the most common cause. systemd does not use your shell's PATH, so write the full path to the program. Run 'ls -l' on the exact path from ExecStart. If it says 'No such file or directory', this is it.
  • •The file is not executable. A script or binary copied in without the execute bit gives 'Permission denied' in the journal. 'ls -l' shows no 'x' in the mode, for example -rw-r--r--.
  • •The script has a bad or missing shebang line. A script with no '#!' first line, a wrong interpreter path (such as /usr/bin/python when only python3 exists), or Windows line endings (CRLF) fails with 203. Run 'head -1 file | cat -A'. A '^M' before the '$' means CRLF line endings.
  • •The binary is for the wrong architecture or is missing its loader. An ARM binary on x86_64 (or the reverse), or a binary built for a different libc, cannot execute. Run 'file /path/to/binary' and compare with 'uname -m'. The journal may show 'Exec format error'.
  • •SELinux, AppArmor or a mount option blocks execution. On RHEL-family systems a wrong SELinux label gives 'Permission denied' even when the mode is fine, and 'ausearch -m avc -ts recent' shows a denial. A binary under a filesystem mounted noexec (often /tmp or /home) also fails. Check with 'findmnt -T /path/to/binary'.
  • •The unit's User= cannot reach the file. If the service runs as a non-root user, that user needs execute permission on every directory in the path, not only the file. 'namei -l /path/to/binary' shows each directory's permissions.

How to fix it

  1. 1. Read the exact reason in the journal

    The status line only says 203. The journal line just above it names the real failure, such as 'No such file or directory', 'Permission denied' or 'Exec format error'. Replace myapp with your unit name.

    systemctl status myapp.service --no-pager
    journalctl -u myapp.service -n 30 --no-pager
  2. 2. Check the ExecStart line in the unit

    Print the unit as systemd sees it, including drop-in overrides. After any optional prefix character such as - or +, the program should be given as a full path starting with /, and that path must point to a real program.

    systemctl cat myapp.service | grep -E '^(ExecStart|User|WorkingDirectory)'
  3. 3. Confirm the file exists and is executable

    Use the exact path from ExecStart. If the execute bit is missing, add it. Review the file first so you do not make an untrusted file executable.

    ls -l /opt/myapp/bin/myapp
    sudo chmod +x /opt/myapp/bin/myapp
  4. 4. Check the shebang and line endings for scripts

    The first line must point to an interpreter that exists, for example #!/usr/bin/env bash or #!/usr/bin/python3. If the file shows ^M, convert it to Unix line endings. This edits the file in place, so keep a copy if it matters.

    head -1 /opt/myapp/bin/start.sh | cat -A
    which bash python3
    sudo sed -i 's/\r$//' /opt/myapp/bin/start.sh
  5. 5. Check architecture and the path permissions

    For compiled binaries, compare the build target with the machine. Then make sure the service user can traverse every parent directory.

    file /opt/myapp/bin/myapp
    uname -m
    namei -l /opt/myapp/bin/myapp
  6. 6. Check SELinux and noexec mounts

    On RHEL, Rocky and AlmaLinux, look for denials and restore the default label. On Ubuntu and Debian, check 'sudo journalctl -k | grep -i apparmor' instead. If findmnt shows noexec, move the binary to a path such as /opt or /usr/local/bin.

    sudo ausearch -m avc -ts recent
    sudo restorecon -v /opt/myapp/bin/myapp
    findmnt -T /opt/myapp/bin/myapp -o TARGET,OPTIONS
  7. 7. Reload systemd and restart the service

    Run daemon-reload after any edit to a unit file. The restart stops and starts the service, so expect a short interruption if it is partly running.

    sudo systemctl daemon-reload
    sudo systemctl restart myapp.service

Confirm it is fixed

The service should show 'active (running)' with no 203 in the status output, and the journal should show no new exec errors. If it still fails, the new journal line will name a different error, which is progress.

systemctl is-active myapp.service
systemctl status myapp.service --no-pager | head -n 5
journalctl -u myapp.service -n 10 --no-pager

How Opservo catches it early

The Opservo agent discovers systemd services, flags units in a failed state and services that have restarted many times, and clusters journal errors into patterns. It raises a recurring error finding with a plain-English AI summary when an error such as this one keeps coming back. Raw log lines are never stored.

Last updated 2026-11-30.

FAQ

Related questions

What does status=203/EXEC mean for the Prometheus service?+

It means systemd could not run the program in the Prometheus unit's ExecStart line. Usually the path to the prometheus binary is wrong, the binary is not executable, or it was built for another architecture. Follow the same steps above using your prometheus.service unit.

Why does it fail when I can run the command by hand?+

Your shell finds the program through its own PATH, but systemd does not use your shell's PATH, so a full path in ExecStart is the safe choice. The service may also run as a different user, or SELinux may block it, even though your own login works.

Is 203/EXEC the same as status=200 or 217?+

No. 203 means the program could not be executed at all. Other codes point to different setup problems, such as 200/CHDIR for a bad WorkingDirectory or 217/USER for a missing user. If the program starts and then exits, you see its own exit code instead.

Do I need daemon-reload after fixing the file?+

Only if you changed the unit file or a drop-in. If you only fixed permissions or the binary, a restart is enough. Running daemon-reload anyway is harmless.

Main process exited, code=exited, status=203/EXEC · Opservo