Re: NSWorkspaceWillPowerOffNotification from a daemon

2009-03-13 Thread Dave Keck
It seems your situation is similar to this: http://lists.apple.com/archives/macnetworkprog/2007/Aug/msg00017.html I just tested, and a normal (non-daemon) Cocoa app _does_ receive the power-off event. It sounds like daemons in particular have an issue receiving it. It appears that IOKit has some

Re: NSWorkspaceWillPowerOffNotification from a daemon

2009-03-12 Thread Matthew Mashyna
On Mar 12, 2009, at 8:45 PM, Nick Zitzmann wrote: On Mar 12, 2009, at 6:11 PM, Matthew Mashyna wrote: The sleep calls work fine but the PowerOff doesn't work ever. Is there another way to catch shutdown ? Can I catch some signal to handle it ? Did you remember to call NSApplicationLoad(

Re: NSWorkspaceWillPowerOffNotification from a daemon

2009-03-12 Thread Nick Zitzmann
On Mar 12, 2009, at 6:11 PM, Matthew Mashyna wrote: The sleep calls work fine but the PowerOff doesn't work ever. Is there another way to catch shutdown ? Can I catch some signal to handle it ? Did you remember to call NSApplicationLoad() before using NSWorkspace? Nick Zitzmann

NSWorkspaceWillPowerOffNotification from a daemon

2009-03-12 Thread Matthew Mashyna
I have a daemon that gets started from /Library/LaunchDaemons. It monitors the system and alerts another remote machine when certain status changes. What I want to monitor is when the machine powers on and off, sleep, monitor sleep. Everything works fine except catching the shutdown. I make