[X-Unix] Find if shutdown is in progress

Jerry Krinock jerry at ieee.org
Thu Mar 24 11:15:25 PDT 2011


No one seems to know the answer on Apple's Darwin developer forum.  So I figured if anyone knows, it would be one of you guys.

Short version:  Is there any command or other trick I can perform to find out if system shutdown is currently in progress?

More detail:  I want to do this so I can prevent my command-line program from starting a long task which is triggered, sometimes, when other apps terminate.  There are a couple of API with which I can register for notifications (NSWorkspaceWillPowerOffNotification, IORegisterForSystemPower) and supposedly get a callback, but they don't work in this context.

Thanks,

Jerry Krinock



More information about the X-Unix mailing list