Python script - Volumio Process

If you’re running a rPi4 or less, you never actually turn off a unit, neither does the GPIO. So if you set the pin high, it will remain high.
You need to create a 2nd script, to turn the led off. (use ChatGPT :wink: )
When that script is ready you need a service that triggers the script on a Software shutdown, like:

sudo nano /lib/systemd/system/shutdown.service

[Unit]
Description=Deactivate LED before shutdown
Before=shutdown.target
Conflicts=shutdown.target

[Service]
Type=oneshot
ExecStop=/usr/bin/python3 /home/volumio/scripts/ledoff.py
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

sudo chmod 644 /lib/systemd/system/shutdown.service && sudo systemctl daemon-reload && sudo systemctl enable shutdown.service && sudo systemctl start shutdown.service

And while you’re at it don’t use rc.local to start things, but use a service.