I have successfully set up motion to run at boot up on a Raspberry Pi running buster Debian Linux.
Now I want to start and stop the service from within my Python program. I started by changing the /etc/default/motion
file from start_motion_daemon=yes
to start_motion_daemon=no
and then rebooting, but the motion service was still automatically starting on boot. Then I ran
sudo systemctl disable motion
and rebooted. That worked. After this, I could successfully issue the command
sudo service motion start
from within my Python program via a subprocess.run() call and the service would start successfully. However, no motion capture occurred after this. Issuing the command
sudo service motion status
revealed a message saying No /usr/bin/motion
.
Does anyone know how to properly do this?