PID constantly changing, can't kill daemon

Yesterday I ran a python script in terminal (python3) with the command: "nohup python3 //name_of_script.py// -u &". Unfortunately I cant kill the process, due to the PID changing faster, than its possible to run the pkill command.

Ive tried:

1.) Ps ax | grep //name_of_process// 

as well as -->

kill -kill $(ps -A | grep //name_of_process// | awk '{print $1}')

both no use. PID changes too fast?

2.)

moving the file into another directory:

no use, PID still constantly changing

3.)

maybe the PID is constantly changing because the daemon is constantly crashing(?). Looked into my LaunchAgents folder and no sign of the script.

Though im not very familiar with the structure of the folder I wasn't able to find anything.

Im not an expert by any means so if there is anything I might have missed, please just leave a comment, no matter how rudimentary it seems. If you have any clue on where the script could be located to auto run on startup, help would be appreciated.

killall does something like your (1).

pstree can be useful; it may identify a parent process that you can kill. That's in homebrew.

Your first step here, IMO, should be to restart. If the problem continues after a restart, there must be some sort of persistent state that’s kicking it off. The most likely cause of that is a launchd job in /Library/LaunchAgents, /Library/LaunchDaemons, or ~/Library/LaunchAgents.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

PID constantly changing, can't kill daemon
 
 
Q