Jun-26-2020, 10:06 PM
(This post was last modified: Jun-26-2020, 10:15 PM by jc_lafleur.)
That is what I was attempting to do with this...
I was thinking maybe because it is running in the background as root? I don't know. It needs to run as root because if I run the scripts as a user, and then SSH into the Pi while everything is running, it will cause the scripts to 'pause' until I end the SSH login session.
Gribouillis
Thank you!
That did the trick!
Simple, elegant, awesome!
import psutil # this kills the timelapse.sh script to stop taking pictures (didn't work) PROCNAME = "timelapse.sh" for proc in psutil.process_iter(): # check whether the process name matches if proc.name() == PROCNAME: proc.kill()But it did not work. The timelapse.sh script was still running after the python script ended, and I didn't get any errors letting me know that it failed to end the bash script. The only way I realized that it had failed was because there were still pictures being written to the SD card after the python script ended. And I verified this with "ps aux" and could still see the timelapse.sh process running.
I was thinking maybe because it is running in the background as root? I don't know. It needs to run as root because if I run the scripts as a user, and then SSH into the Pi while everything is running, it will cause the scripts to 'pause' until I end the SSH login session.
Gribouillis
Thank you!
That did the trick!
Simple, elegant, awesome!