nginx startup error: nginx working. Service failed because control process exited, error code
>>> service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
as prompted:
systemctl status nginx.service
>>> systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since 五 2018-08-31 11:08:14 CST; 5min ago
Process: 4668 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=1/FAILURE)
Process: 28149 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 28146 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 4455 (code=killed, signal=KILL)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:14 user-70DGA014CN nginx[28149]: nginx: [emerg] still could not bind()
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Control process exited, code=exited status=1
8月 31 11:08:14 user-70DGA014CN systemd[1]: Failed to start A high performance web server and a reverse proxy server.
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Unit entered failed state.
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Failed with result 'exit-code'.
8月 31 11:08:49 user-70DGA014CN systemd[1]: Stopped A high performance web server and a reverse proxy server.
journalctl -xe
>>> journalctl -xe
8月 31 11:08:12 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:12 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:12 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:12 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 31 11:08:13 user-70DGA014CN nginx[28149]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 31 11:08:14 user-70DGA014CN nginx[28149]: nginx: [emerg] still could not bind()
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Control process exited, code=exited status=1
8月 31 11:08:14 user-70DGA014CN systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: nginx.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- nginx.service
--
-- Output:“failed”。
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Unit entered failed state.
8月 31 11:08:14 user-70DGA014CN systemd[1]: nginx.service: Failed with result 'exit-code'.
8月 31 11:08:49 user-70DGA014CN systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Subject: nginx.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- nginx.service
From the above information, it can be seen that nginx’s port 80 is being used (but this is not the main issue) </p b>
first solution:
note:
if used to modify the/etc/nginx/conf. D/default. Conf or/etc/nginx/nginx. Conf file, and use the command: systemctl restart nginx. The service, so will appear the error information is as follows:
>>> service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
you need to open default.conf or nginx.conf to see if a semicolon is missing.
second solution:
- uninstalls nginx and deletes nginx files.
- reload nginx
Read More:
- Job for docker.service failed because the control process exited with error code. See systemctl sta
- systemctl start docker Job for docker.service failed because the control process exited with error
- Linux virtual machine network “job for” network.service failed because the control process exited with error code”
- Job for network.service Failed because the control process exited with error code. See “SystemC
- Apache2 cannot be started and an error is reported for apache2.service failed because the control process exited with error code.
- Nginx startup error: nginx: [error] open() “/ var / run / nginx/ nginx.pid The solution of “failed (2: no such file or directory)”
- nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- /var/run/nginx/nginx.pid” failed (2: No such file or directory)
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- Error! Failed to start nginx
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- nginx: [error] open() “/usr/local/var/run/nginx.pid” failed (2: No such file or directory)
- nginx: open() “/var/run/nginx.pid“ failed (2: No such file or directory)
- nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“
- Solve the problem of starting nginx nginx.pid error
- NxL job cluster nginx routing forwarding and reverse proxy
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Failed to start Remote desktop service (VNC)