0

i am using 2 python programs with rc.local for my raspberry, first program is my main program and the other is the second program. The second program is shutdown the raspberry, but when i do the second program my first program is still running and will stopped until raspberry truly shutdown. I want to make the second program kill the first program before raspberry truly shutdown, how can i do it?

jamylak
  • 128,818
  • 30
  • 231
  • 230
jendol
  • 53
  • 1
  • 6
  • 1
    possible duplicate of [How to terminate process from Python using pid?](http://stackoverflow.com/questions/17856928/how-to-terminate-process-from-python-using-pid) – Marc B Jun 16 '15 at 14:26

1 Answers1

0

Maybe an easier way would be to use the shell to kill the process in question? Each process in linux has a number assigned to it, which you can see by typing

pstree -p

In your terminal. You can then kill the process by typing in

sudo kill process number

Does that help, or were you thinking of something a bit more complicated?