简体   繁体   中英

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

  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, eg ps aux | grep my_executable | grep -v grep ps aux | grep my_executable | grep -v grep

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM