How should userland app be notified when kernel comes out of suspend or hibernation?
From: Dale Mellor
Date: Fri Feb 14 2025 - 16:49:31 EST
I am the originator of the GNU mcron app, which waits (using select)
for set amounts of time before executing some function on behalf of the
user. But when the system comes out of sleep the timings are all wrong
and need to be re-evaluated. But how does my application know when
this needs to happen?
I'm currently trying to use the ACPI netlink interface, which
conveniently gives me a socket I can add to the select call and wakes
me up when some power-changing event occurs. However, there is not an
event specifically for notifying the coming out of sleep, and different
systems will have different hardware which reacts in this situation
(the netlink interface has a soft specification and requires
introspection to understand the data it delivers).
What is the 'official' way to do this?
Attachment:
signature.asc
Description: This is a digitally signed message part