Welcome! Log In Create A New Profile

Advanced

nginx service wouldn't start

Posted by olegse 
nginx service wouldn't start
April 19, 2016 09:27AM
Hello,
I'm trying to run nginx server on CentOS7 and getting the following errors:

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

When checking for a status I got the following:

` Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2016-04-19 15:25:56 CEST; 57s ago
Process: 19132 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 19130 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 18515 (code=exited, status=0/SUCCESS)`

Is it any suggestions where should I start to debug? Thanks.
Re: nginx service wouldn't start
April 19, 2016 10:08AM
You are running "nginx -t" which failed so check the logs.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: nginx service wouldn't start
April 19, 2016 12:24PM
yes the output of the test is:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

but when I'm trying to run `sudo -nginx -s reload` I got this error:

nginx: [error] invalid PID number "" in "/run/nginx.pid"

I actually have this entry in /etc/nginx/nginx.conf this file exists but it is empty

How it can be solved?
Re: nginx service wouldn't start
April 19, 2016 01:09PM
Kill all nginx instances and try a plain start.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: nginx service wouldn't start
April 20, 2016 01:46PM
The issue is seems to be solved for me.
I was able to start the server any way by issuing:
`sudo systemctl start nginx.service`

after creating manually '/run/nginx.pid' I'm able to reload the server by:
`sudo nginx -s reload`



Edited 1 time(s). Last edit at 04/20/2016 01:47PM by olegse.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready