"No such process" when trying to kill a running python script

10,831

Solution 1

Try a pkill to kill the process, but you might also check your cron: it's possible that you kill the process but that the crontab restarts it constantly.

Solution 2

  • First of all, check whether The listed process was probably a zombie process? therefore you cannot kill. Its live-time is depending on its parent process.
  • If you add the u flag to the call of ps, it displays also the STAT column which is Z for zombie processes.
  • if its a zombie process this has perfect explanation How to kill zombie process

if its not a zombie process try this, killall [process name] command. expects a process name, e.g. killall gedit which kills all such processes.

For more refer man killall

Share:
10,831
it's me
Author by

it's me

Updated on June 04, 2022

Comments

  • it's me
    it's me almost 2 years

    I saw and tried many solutions.

    I used ps aux | grep script.py to get the pid of the process. I got the following output: bioseq 24739 0.0 0.0 112884 1200 pts/1 R+ 13:20 0:00 grep --color=auto /script.py , and then typed: kill 112884 and got the output 112884: No such process.

    I also tried a similar command with grep -i, which yielded a different pid. kill <pid> also yielded <pid> No such process.

  • it's me
    it's me over 3 years
    I didn't run it with cron, just run the script from the terminal.
  • Dominique
    Dominique over 3 years
    If you run it from the terminal, then you should be able to stop it using that terminal (you can also turn off the terminal). However, there is the possibility that the script subscribed itself to the cron, causing it to repeat itself. So it might be interesting to check crontab settings.