Thursday, 8 August 2013

How does system daemon get shutdown notification on Mac OS

How does system daemon get shutdown notification on Mac OS

For some reasons, my system daemon needs to get shutdown notification.
I tried to use NSWorkspaceWillPowerOffNotification as this post. It seems
not working.
I found this thread. At the end of the thread, uThe code in this answer
looks correct but the notification will not be sent to a daemon process --
the code would work fine for an application.v
In this post, the writer said uWell, the documentation for
IORegisterForSystemPower() states that it is "for the purpose of receiving
sleep & wake notifications for the system. Does not provide system
shutdown and restart notifications."v
Are there any ways to get shutdown notification in my system-wide daemon??
Thanks.

No comments:

Post a Comment