1

I have started a python script by following:

nohup python src/myscript.py &

Now there is a process running, where the PID is changing constantly, so it is absolutely not possible to kill it. When I try this one nohup process killing, it says the -sh: kill: (8792) - No such process.

Also tried to grep it by name and kill it, same issue, because the PID is changing constantly. As noted by @MarcusMüller in a comment, apparently this is because it constantly spawns new browser instances.

Really confused why nothing is working, restart did not work. Considering to reinstall whole system ...

8
  • 1
    nohup doesn't change PIDs (try with nohup sleep 600). In fact, it's impossible to change PIDs at runtime as process. more likely, your script is forking/spawing a lot of subprocesses. What specifically does myscript.py do? Commented Jun 16, 2021 at 21:56
  • How are you starting the program after rebooting? Commented Jun 16, 2021 at 22:07
  • @Gilles'SO-stopbeingevil' I am not starting the Program after reboot, it is still there...
    – csnewb
    Commented Jun 16, 2021 at 22:16
  • Have you tried the killall command, specifying the process command line as shown in top et al... Commented Jun 16, 2021 at 22:17
  • 2
    impfbot continuously spawns new browsers. Of course you get new PIDs that way. Commented Jun 16, 2021 at 22:46

1 Answer 1

1

Assuming the process command appears like 'python src/myscript.py' in process listings such as ps, top, htop etc:-

killall -s STOP 'python src/myscript.py' would pause the processes; -s CONT would resume them,

To see all signals, killall -l, but sending TERM should terminate them - and ABRT should forcibly remove them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .