I’m installing the OnOff Shim on a Minecraft server (RPi4). The OnOff Shim works perfectly but how to configure it to shutdown safely my Minecraft server before to shutdown the power? This question doesn’t concern specifically Minecraft, it concerns any kind of servers in which a dedicated shutdown process must be triggered to avoid a server data corruption.
The problem is I cannot launch the server shutdown in parallel to the shutdown process because the server shutdown takes a litte bit of time (arround 20s), and as a safety measure I have to check that it is effectively stopped.
In my case I should:
- intercept the button request (GPIO 17)
- initiate the server shutdown (typically a stop.sh script) and wait until it’s done
- then continue with the power shutdown (GPIO 4)
I tried to understand what the OnOff scripts are doing exactly but it appears a little bit cryptic for me…
Any help is welcome.