[X-Unix] Find if shutdown is in progress

Michael Wheeler mwheeler at tntech.edu
Fri Mar 25 12:33:26 PDT 2011


Not sure if this will work or not but have you tried checking the runlevel?

who -r

Michael W. Wheeler, OpenVMS, Windows, Solaris and Macintosh
Systems Support, Tennessee Technological University




On Mar 24, 2011, at 1:15 PM, Jerry Krinock wrote:

> 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
> 
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix



More information about the X-Unix mailing list