Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using systemd instead of supervisor #149

Open
christiansievers opened this issue Mar 24, 2022 · 4 comments
Open

using systemd instead of supervisor #149

christiansievers opened this issue Mar 24, 2022 · 4 comments

Comments

@christiansievers
Copy link
Contributor

I had a go at the idea to run it via systemd, using the branch you started. It appears the devil is in the details of the video_looper.service file. I noticed two things.

  • journalctl -fu video_looper showed of module not found errors. All the info about systemd I found tells me the ExecStart command needs full paths. So just as a test I ran something simpler, and this works fine:
# systemd configuration to run video looper at boot and
# ensure it runs continuously.

[Unit]
Description=Adafruit Raspberry Pi Video Looper
After=getty.target
# after login prompt appears


[Service]
TimeoutStartSec=0
Type=simple
ExecStart=/usr/bin/omxplayer -r --loop -o both "/home/pi/testvideo.mp4"
#ExecStart=/usr/bin/python3 -u -m Adafruit_Video_Looper.video_looper 
Restart=always
RestartSec=3
User=root

[Install]
WantedBy=multi-user.target

So the error lies with ExecStart=sudo /usr/bin/python3 -u -m Adafruit_Video_Looper.video_looper. Probably the 2nd half of that line. The examples I found don't use python packages but single python script files. I don't know how to link to the package. /usr/local/lib/python3.7/dist-packages/Adafruit_Video_Looper.video_looper doesn't seem to work. And it may install somewhere else on another system.

  • Also note the After=getty.target which tells systemd to run it after the login prompt appears.

Just sharing my notes with you, no rush...

@tofuSCHNITZEL
Copy link
Collaborator

tofuSCHNITZEL commented Apr 21, 2022

just a heads up. this is already part of the dev branch (together with the pip install change which solves the module not found error) still needs some testing though

@tofuSCHNITZEL
Copy link
Collaborator

@christiansievers: I'm quite far regarding this change... the only issue is that running omxplayer as non root - (which is mandatory with cvlc - so better to figure out now) is that the image from the omxplayer process is just not visible... maybe you have some ideas and could try out the dev branch...
I also opted to try to "harmonise" the install across different PI OSs by adding the pi user if non existent so the player can run under that user.

@christiansievers
Copy link
Contributor Author

that's a lot of changes. I'll have a go when I find the time!

@tofuSCHNITZEL
Copy link
Collaborator

yeah sorry one thing led to another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants