KM617
KM617

Reputation: 135

kill nohup not working with kill -9 PID

I have server running with nohup on port 80. I try

ps aux | grep nohup

and get

root 9234 0.0 0.1 11740 932 pts/1 S+ 15:19 0:00 grep --color=auto nohup

I then try kill -9 11740 (which I believe is the PID) and get an error stating 'no such process." I can't figure out how else to remove this. Any help is appreciated. Thanks

Upvotes: 0

Views: 1109

Answers (2)

gudok
gudok

Reputation: 4189

  1. 11740 is virtual memory size. PID is the second field, 9234.
  2. The process in your output is grep command itself, not nohup.
  3. You won't see standalone nohup process. When you start some process with nohup my_executable, nohup closes/redirects stdin/stdout/stderr properly, setups necessary signal handlers and replaces itself with my_executable. Search instead for executable which was started with nohup, e.g. ps aux | grep my_executable | grep -v grep

Upvotes: 1

Dan
Dan

Reputation: 11104

The process you are seeing is the process from your grep command. So by the time you are trying to kill it, the process is already over.

To keep it out of the output use:

ps aux | grep nohup | grep -v 'grep'

It looks like you don't have a nohup process running

Upvotes: 0

Related Questions