Nginx start error: job for nginx.service failed because the control process exited with error code

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:

  1. uninstalls nginx and deletes nginx files.
  2. reload nginx

Read More: