I’d like to run a script after mount-ro is completed on shutdown (I’m working on an SBC that has no visible output, so I want to toggle an LED to show when it’s safe to switch off).
If I just put a ‘stop’ script in /etc/local.d I think it’s run too early - before mount-ro is completed.
I feel like to do this properly, I should make a new service in /etc/init.d/ that depends on mount-ro, and then rc-update add led_off shutdown. But I’m confused about how openrc deals with ’services’ that are run-once rather than ongoing daemons. All the docs I can find suggest that /etc/init.d/ items are for starting daemon-like services that are running or not, and openrc should be able to manage start up and shut down independently. But for a script like this, there is no ‘running’ or ‘shutting down’.
Is there a way to tell openrc that my ’service’ is ‘run-once’? Am I overthinking this and it will ‘just work’? I want to ensure I’m doing things the right way...


