Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am unable to stop nginx server by the command sudo /etc/init.d/nginx stop

tried killing it through pid

First I check the process which is listening to a port via this command.

lsof -Pnl +M -i4

Then I kill it by

sudo kill -9 pid

The app is still running!!. After that when i again do

lsof -Pnl +M -i4

I see that a new process is now listening on the same port, for which i tried to kill the process.

Regards, Pankaj

share|improve this question

Did you try stopping the process as root?

share|improve this answer

check that path to pid in initscript and path to pid in nginx.conf are identical

share|improve this answer
in nginx.conf the line for path to pid is commented. In initscript what I understand by this is the file /etc/init.d/nginx has the following contents – user68613 Jan 29 '11 at 5:43

Are you sure the process is not a zombie? When it is a zombie, in most cases only a reboot will help.

You can read more about zombies here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.