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 these calls to keep tabs on things:

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillPowerOff:) name:NSWorkspaceWillPowerOffNotification object:nil]; [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillSleep:) name:NSWorkspaceWillSleepNotification object:nil]; [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWokeUp:) name:NSWorkspaceDidWakeNotification object:nil];

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 ?

Thanks,
Matt



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to