Bug #559
NGINX Package: Stopping does not kill processes
| Status: | Closed | Start date: | 03/25/2011 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | Aports | |||
| Target version: | Alpine 2.2.0 |
Description
I have nginx 0.8.54 installed from the alpine edge main repository. I made some changes to the conf so I decided to reload it: /etc/init.d/nginx reload. Doing so resulted in the following:
mp5shooter:~# /etc/init.d/nginx reload
* Checking nginx' configuration ...
the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful [ ok ]
* Refreshing nginx' configuration ...
cat: can't open '/var/run/nginx.pid': No such file or directory
* Failed to reload nginx [ !! ]
When I do 'ps x' the nginx master process and the worker processes are still running. Attempting to start nginx before killing them manually will result in many port bind errors. This also happens when stopping the server entirely (the processes don't die) and also when restarting. Each time, you have to go in and manually kill the master process (which kills the worker processes).
History
Updated by Mp5 Shooter about 1 year ago
Also, another little bug:
mp5shooter:~# /etc/init.d/nginx stop- Checking nginx' configuration ...
the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful [ ok ] - Stopping nginx ...
- start-stop-daemon: fopen `/var/run/nginx.pid': No such file or directory [ ok ]
Updated by Cameron Banta about 1 year ago
Hmm, those are the same issue. The problem appears to be that the pid file is not getting written to /var/run/nginx.pid when you start nginx. I don't have any problems at all myself.
Are you running as root when you run '/etc/init.d/nginx stop'?
Did you run '/etc/init.d/nginx start' to start it?
Can root write to /var/run?
Updated by Mp5 Shooter about 1 year ago
Yes, I am running as root.
Yes, I ran '/etc/init.d/nginx start' to start it.
Root can write to anything! haha
Updated by Cameron Banta about 1 year ago
You might also check if you have a pid defined in your /etc/nginx/nginx.conf file.
Mine looks like this:
#pid logs/nginx.pid;
But this should also work:
pid /var/run/nginx.pid;
Updated by Mp5 Shooter about 1 year ago
Oh.. silly me. I had set it to
pid /var/log/nginx/nginx.pid;
log, not run. Sigh. Sorry. It all works fine now.
Updated by Cameron Banta about 1 year ago
- Status changed from New to Closed
- Priority changed from High to Low
- % Done changed from 0 to 100