Technical Discussion
  >> Apple Issues


Register (or login) on our website and you will not see this ad.


  Print Thread
Standard User caffn8me
(knowledge is power) Wed 30-Oct-13 05:12:32
Print Post

Shutdown at specific time, not using Energy Saver


[link to this post]
 
I'm setting up a Mac running OS X 10.8.5 to do the following;

  • Start up automatically at a specific time
  • Launch a Parallels virtual machine (Windows 7)
  • Run a program on Windows to collect data
  • Suspend the Parallels virtual machine
  • Shut down the Mac

The machine starts up nicely using Energy Saver scheduler as expected.

I'm using custom launchd.plist entries to run the Windows VM and suspend it. This happens without there being a graphical login to the Mac.

I cannot use Energy Saver to schedule a shutdown because there has to be a user logged in for that to work.

At the moment I can't get a launchd.plist to shutdown because Unix security prevents anonymous shutdown.

The log entry is;

Text
1
2
30/10/2013 04:17:08.783 com.apple.launchd[1]: (0x7fe6c0423fa0.anonymous.shutdown[449]) Switching sessions is not allowed in the system Mach bootstrap.
30/10/2013 04:17:08.783 com.apple.launchd[1]: (0x7fe6c0423fa0.anonymous.shutdown[449]) _vprocmgr_switch_to_session(): kr = 0x44c


Does anyone have any suggestions?

Sarah

--
If I can't drink my bowl of coffee three times daily, then in my torment, I will shrivel up like a piece of roast goat

Spiders on coffee - Badass spiders on drugs
Standard User caffn8me
(knowledge is power) Wed 30-Oct-13 05:31:22
Print Post

Re: Shutdown at specific time, not using Energy Saver


[re: caffn8me] [link to this post]
 
OK, false alarm, I seem to have solved this by using the pmset command smile

Sarah

--
If I can't drink my bowl of coffee three times daily, then in my torment, I will shrivel up like a piece of roast goat

Spiders on coffee - Badass spiders on drugs
Standard User AEP
(eat-sleep-adslguide) Wed 30-Oct-13 06:57:55
Print Post

Re: Shutdown at specific time, not using Energy Saver


[re: caffn8me] [link to this post]
 
I was going to suggest using cron to runn the "shutdown" command, but I haven't tried it.


Register (or login) on our website and you will not see this ad.

Standard User caffn8me
(knowledge is power) Wed 30-Oct-13 07:01:49
Print Post

Re: Shutdown at specific time, not using Energy Saver


[re: AEP] [link to this post]
 
cron may very well run into the same problems as launchd. I know that in OS X, cron is now frowned upon.

pmset turns out to be ridiculously easy to use and doesn't care whether a user is logged in or not. If a user is logged in they get a popup window allowing them to stop the scheduled shutdown.

Sarah

--
If I can't drink my bowl of coffee three times daily, then in my torment, I will shrivel up like a piece of roast goat

Spiders on coffee - Badass spiders on drugs
  Print Thread

Jump to