Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOSX 10.8.2: How to clear unwanted power-management assertions?

There are some programs that run under MacOSX Mountain Lion which are now (since installing 10.8.2) causing unwanted power-management assertions to be set. I'm looking for a way to clear assertions like these.

Here's one example: one or more of these programs cause the following power-management assertion to be set within "powerd". Note the "powerd" line, below ...

% pmset -g assertions    
10/7/12 11:51:47 AM EDT  
Assertion status system-wide:
   PreventUserIdleDisplaySleep    1
   CPUBoundAssertion              0
   PreventSystemSleep             0
   PreventUserIdleSystemSleep     0
   ExternalMedia                  0
   UserIsActive                   0
   ApplePushServiceTask           0
   BackgroundTask                 0

Listed by owning process:
  pid 18(powerd): [0x00000005000001d7] 11:24:18 PreventUserIdleDisplaySleep named: "com.apple.powermanagement.delayDisplayOff" 
... etc. ...

These programs exit and leave this power-management assertion in place within "powerd", and it remains active forever. This prevents "display sleep" and the screen saver from ever being invoked.

The only option I know of in this case (aside from rebooting) is to do a "kill -HUP" on the "powerd" process. This causes that daemon to exit and restart without the incorrect assertion.

Does anyone know of a way under 10.8.2 for me to clear the "PreventUserIdleDisplaySleep" assertion within "powerd", without forcing a restart of that daemon? I'm happy to do this via a Cocoa, Carbon, or AppleScript program, if necessary.

I know about IOPMLib, but the routines within that library only seem to be able to clear power assertions that have been created within the same process. I need a way to tell the external and already-running "powerd" process to clear the "PreventUserIdleDisplaySleep" assertion that it manages. Does anyone know of an API for externally setting and clearing power-management assertions within a running "powerd" instance? Perhaps via some sort of notification ... ???

like image 964
HippoMan Avatar asked Oct 08 '12 23:10

HippoMan


1 Answers

The answer is very simple. I had the same problem.

Make a back up of the following folders that can be found in /Library/LaunchAgents/LaunchDaemons/Internet Plug-ins. Next. Empty the contents of the folders. Then restart your mac. Test your energy settings or just test in terminal (pmset -g assertions). Your problem should be solved. You can put the files back one by one to find the file that's causing the problem or leave it this way.

You'll get a pop up when you use Safari and there are missing plugins. You can simply reinstall them. Your mac should work fine either way.

like image 121
Jordy Jansen Avatar answered Oct 11 '22 21:10

Jordy Jansen