topguy wrote: ↑Mon Oct 22, 2018 10:13 am
I dont know what "Alpine" is, you are not running Raspbian ?
https://alpinelinux.org/
It's a lovely little distribution. Light & fast, moreso aimed at servers and docker type stuff but can be coaxed into more general usage running the rolling edge branch. I've been really enjoying it on my 10+yr laptop since the summer. The default pi install also runs in RAM which can be useful.
----------
Anyway.....
I now have a pi3 with retropie on it at the moment, which appears to be raspbian/debian 9.6 under the hood.
In an attempt to have looping video on boot as an optional extra on my pi alongside everything else I thought I'd give systemd a shot.
I have a script to play the files:
Code: Select all
#!/bin/sh
while true
do
filename=$(ls /home/pi/video/movies/ | shuf -n 1)
omxplayer -r /home/pi/video/movies/"$filename"
sleep 2
done
and have a systemd service:
Code: Select all
[Unit]
Description=Ambient scenery display
Before=systemd-user-sessions.service
[Service]
TimeoutStartSec=0
ExecStart=/home/pi/scripts/loopvideo.sh
Type=simple
User=pi
ExecStop=/usr/bin/killall omxplayer
User=pi
I can the start the service and it runs just fine with systemctl start omxplayer but if I try to enable the service with systemd I get:
Code: Select all
$ sudo systemctl enable omxplayer
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.
Any idea on how to get systemd to enable this service? I have barely used systemd and it's been a few years at least but figuring if it's managing to start the service I'm not too far from enabling.