0

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?

1 Answer 1

0

I decided to abandon running motion as a service and use subprocess.Popen() from within my program to start and stop the motion application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.