Skip to content

/errors/systemd/job-failed-because-the-control-process-exited-with-error-code

Job for nginx.service failed because the control process exited with error code

The commands on this page have not been executed by our verification runner yet.updated
tool
systemd
exit code
1
versions
systemd 2xx
os
linux

Job for nginx.service failed because the control process exited with error code. means systemd ran the service's start command (ExecStart, or an ExecStartPre check) and it exited with a non-zero status. systemd only reports that it failed; the program's own error is in the journal. Run the two commands the message suggests, systemctl status nginx.service and journalctl -xeu nginx.service, and fix what the last log lines say, most often a configuration error or a port already in use.

The full message, as written in systemd's source:

text
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.

Older systemd versions suggest journalctl -xe without the unit name.

Read the real error

bash
systemctl status nginx.service --no-pager -l    # state, exit status, last log lines
journalctl -xeu nginx.service                    # full log of the unit, explained, newest at the end
journalctl -u nginx.service -b --no-pager | tail -n 30

status shows a line like Process: 1234 ExecStart=/usr/sbin/nginx ... (code=exited, status=1/FAILURE), which tells you which command failed.

Common causes

Log saysFix
configuration file ... test failed, unknown directive, syntax errorTest the config (nginx -t, sshd -t, apachectl configtest) and fix it
Address already in use, bind() ... failedss -ltnp to find the process on the port; stop it or change the port
Permission deniedCheck file ownership and modes, and SELinux (ausearch -m avc) or AppArmor denials
No such file or directory (for the binary)Fix ExecStart= in the unit file, then systemctl daemon-reload
status=203/EXECThe ExecStart binary could not be executed: wrong path or not executable

The same message template exists for other results: because a timeout was exceeded (the service did not finish starting within TimeoutStartSec), because a fatal signal was delivered to the control process, and because start of the service was attempted too often. For the last one, clear the counter with systemctl reset-failed NAME.service after fixing the cause, then start it again.

After editing a unit file

bash
sudo systemctl daemon-reload
sudo systemctl restart nginx.service
systemctl is-active nginx.service

Sources