# Safe shutdown Embedded Linux on Power-Down

I am not very experienced with Embedded Linux, just some projects with the Raspberry Pi.

I would like to know if there are any recommended ways to shutdown the Embedded Linux if the device's power is removed suddenly, or if common-practice is to just ignore it.

• if power is removed, I don't see how you'd shut down, or do you mean if some external power is removed and you still have some time? In that case, you'd just have something that triggers a userland process to initiate the shutdown routine. – Marcus Müller Oct 4 '19 at 18:20
• Yeah, something like that, like: "do people that implement Embedded Linux, on environments where power cab be (and usually is) just cut-off, make protections on the hardware to give the OS time to proper shut-down, like with super-caps, or don't they even care at all?" – mFeinstein Oct 4 '19 at 18:24

Well there are lot of UPS boards, but many of them are useless, they just invoke sudo shutdown -h nowscript at detected power outage and the capacitors supply the board for few seconds. But if you reconnect the power before the capacitors are drained out, then the board won't start again automatically.