I have a Script named PirateRadio.py That I am writing a script for. I need to kill and reload the script. Possibly with the same PID. I thought SIGHUP was a sure thing. when i run #pkill -1 PirateRadio.py

Nothing happens. Radio keeps on going. Ok, I tried #pkill -9 PirateRadio.py still nothing, radio keeps right on.

ps aux | grep Pir
root    987 45.7 10.8 1266088 433868 ?      Sl   Mar15 2728:13 /root/PirateRadio.py
root    24924  0.0  0.0   4388   800 pts/0    S+   11:13   0:00 grep PirateRadio.py

so then I tried #kill -s 1 987 nothing happens. #kill -s 1 987

then, system hang. So I dont want that, i guess. So then I use: #kill -s 9 987

which kills the script well enough. I’ve used pkill on my other desktops, What is going on here? where can I look to find out what pkill is or isn’t doing?

I looked in dmesg, but saw no change after running pkill I saw no verbose option in pkill man pages..


From the pkill manpage:

The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline.

So try

pkill -1 -f PirateRadio.py