Replace incron with python inotify script + watchdog for managing slideshow restarts during management of picture files, this is operating on a 3s timeout for the restart which seems to be a decent balance given how fast syncthing can move files at times
This commit is contained in:
parent
559eff9e20
commit
cd955d170c
|
@ -208,14 +208,25 @@ EOF
|
|||
systemctl daemon-reload
|
||||
systemctl enable --now no-cursor-tty1
|
||||
systemctl enable --now fim
|
||||
apt install incron
|
||||
cat > /etc/incron.d/fim-delete <<EOF
|
||||
/tank/pictures IN_DELETE systemctl restart fim
|
||||
git clone https://git.kemonine.info/kemonine/piframe.git /opt/piframe
|
||||
cp /opt/piframe/inotify-pictures.py /usr/local/bin/
|
||||
chmod a+x /usr/local/bin/inotify-pictures.py
|
||||
cat > /etc/systemd/system/inotify-pictures.service <<EOF
|
||||
[Unit]
|
||||
Description=Watch for picture folder changes and restart slideshow
|
||||
After=fim.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
ExecStart=/usr/local/bin/inotify-pictures.py
|
||||
TimeoutSec=15
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat > /etc/incron.d/fim-create <<EOF
|
||||
/tank/pictures IN_CREATE systemctl restart fim
|
||||
EOF
|
||||
systemctl enable --now incron
|
||||
systemctl restart incron
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now inotify-pictures
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue