I am trying to get my raspberry pi 3 (running Raspbian 10) to show an animation on boot and before shutdown/reboot.
using Plymouth I managed to get the boot animation, however, it doesn't display anything on reboot/shutdown. So I wrote a small shell script and linked it with systemd services to show the animation before shutdown.target reboot.target.
here is what I tried:
/etc/systemd/system/run2.service :
[Unit]
Description=Run a script at shutdown
Before=multi-user.target
[Service]
RemainAfterExit=yes
ExecStop=/lib/systemd/system-shutdown/test.sh
[Install]
WantedBy=multi-user.target
for the Before=.. I also tried Before=shutdown.target reboot.target and Before=plymouth.target, they have the same result as explained above.
/lib/systemd/system-shutdown/test.sh :
#! /bin/bash
sudo plymouthd
sudo plymouth show-splash
sudo sleep 5
sudo touch /home/pi/Desktop/test
then:
sudo chmod 644 /etc/systemd/system/run2.service
sudo chmod +x /lib/systemd/system-shutdown/test.sh
sudo systemctl enable run2.service
on each restart, the file test is created on the desktop but right after a reboot or shutdown now command but the screen goes blank without showing any animation.
can anybody give a newbie explanation on this subject?
Thanks