please note the 2 (of many) solutions I've attempted to use to kill the timelapse.sh bash script are REMed out as I could get neither of them to work. Then have the motor return to it's starting position. Once the stepper motor has completed it's pan, then gracefully kill the bash script that is running the camera. On boot, automatically start the motor panning, and start the camera taking pictures. I need both scripts to run in parallel in order to control frame rates and panning speed independently from each other. The goal is to create a sunrise to sunset panoramic timelapse video.
The python script is running a stepper motor, the bash script is running a timelapse series with the Pi camera. In that python script I call a bash script to also start (it also runs as root). I am running a python3 script automatically at startup from init.d (it runs as root). I am running this on a Raspberry Pi Zero W running the latest version of RasPiOS and Python3. I need to gracefully kill a bash script from inside a python script, and so far I can't make it work. Not sure if this is the best place to ask this question, but I've been looking all over Stack Exchange and other forums for the past week and still haven't found a working solution for this.