[systemd-devel] Custom power off

Reindl Harald h.reindl at thelounge.net
Wed Dec 20 18:19:56 UTC 2017



Am 20.12.2017 um 18:54 schrieb Zygmunt Ptak:
> I want to implement custom power off method.
> I added to the yocto script: /usr/sbin/halt.local which will power off
> my machine.
> 
> [  OK  ] Reached target Shutdown.
>           Starting /usr/sbin/halt.local Compatibility...
> My power off
> [   76.916101] EXT4-fs (mmcblk1p1): re-mounted. Opts: (null)
> [  OK  ] Started /usr/sbin/halt.local Compatibility.
> [  OK  ] Reached target Final Step.
>           Starting Power-Off...
> [   77.357245] systemd-shutdown[1]: All filesystems unmounted.
> [   77.362835] systemd-shutdown[1]: Deactivating swaps.
> [   77.367923] systemd-shutdown[1]: All swaps deactivated.
> [   77.373168] systemd-shutdown[1]: Detaching loop devices.
> [   77.390252] systemd-shutdown[1]: All loop devices detached.
> [   77.395883] systemd-shutdown[1]: Detaching DM devices.
> [   77.401337] systemd-shutdown[1]: All DM devices detached.
> [   77.409285] systemd-shutdown[1]: Powering off.
> [   77.431515] reboot: System halted
> 
> "My power off" will power off machine, but to early.
> 
> I want to call my script after:
> "[   77.409285] systemd-shutdown[1]: Powering off."
> 
> How to do it?
how do you imagine that after "All filesystems unmounted"

probably somehow with dracut/initramfs but not that way and even then 
you can't do that much after everything is gone


More information about the systemd-devel mailing list