Posted on 09-26-2015 09:33 AM
Hello,
Once we upgraded to Yosemite for the school year, our Energy Savings Profile stopped working. I confirmed with the logs that it wakes up in the morning, but does not shut down. When I go to System Preferences to confirm that the profile being pushed was received on the client end, I see the profile.
I tried changing the settings around, and see that the Mac gets the change, but it still does not shut down.
Our Macs are on 10.10.3 and up, and we are on JSS 9.63.
Solved! Go to Solution.
Posted on 09-26-2015 01:02 PM
This is intended behavior for OS X Yosemite. Which I find pretty dumb.
https://support.apple.com/kb/PH18583?locale=en_US
Your Mac must be awake and you must be logged in for it to shut down at the scheduled time. If you are not logged in or your Mac is in sleep, it won’t shut down.
Here's a launch daemon that shutdowns the machine at 11 PM, I then use a config profile to power them back on.
Package as a .pkg and deploy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.org.shutdown</string>
<key>UserName</key>
<string>root</string>
<key>Program</key>
<string>/sbin/shutdown</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/shutdown</string>
<string>-h</string>
<string>now</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>23</integer>
<key>Minute</key>
<integer>00</integer>
</dict>
</dict>
</plist>
Post flight (After script)
#!/bin/bash
chown root "/Library/LaunchDaemons/com.org.shutdown.plist"
chmod 644 "/Library/LaunchDaemons/com.org.shutdown.plist"
launchctl load -w "/Library/LaunchDaemons/com.org.shutdown.plist"
Posted on 09-26-2015 09:41 AM
Another note I forgot: Our laptops shutdown, but the desktops stay on.
Posted on 09-26-2015 01:02 PM
This is intended behavior for OS X Yosemite. Which I find pretty dumb.
https://support.apple.com/kb/PH18583?locale=en_US
Your Mac must be awake and you must be logged in for it to shut down at the scheduled time. If you are not logged in or your Mac is in sleep, it won’t shut down.
Here's a launch daemon that shutdowns the machine at 11 PM, I then use a config profile to power them back on.
Package as a .pkg and deploy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.org.shutdown</string>
<key>UserName</key>
<string>root</string>
<key>Program</key>
<string>/sbin/shutdown</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/shutdown</string>
<string>-h</string>
<string>now</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>23</integer>
<key>Minute</key>
<integer>00</integer>
</dict>
</dict>
</plist>
Post flight (After script)
#!/bin/bash
chown root "/Library/LaunchDaemons/com.org.shutdown.plist"
chmod 644 "/Library/LaunchDaemons/com.org.shutdown.plist"
launchctl load -w "/Library/LaunchDaemons/com.org.shutdown.plist"
Posted on 09-26-2015 01:23 PM
Terrific. Thanks so much.
Posted on 09-28-2015 07:17 AM
Are you kidding me? I fully agree that that is pretty dumb.
And thank you both, for asking the question and providing the answer. I was tearing my hair out trying to figure out why my lab computers weren't shutting down as intended.
Posted on 10-30-2015 01:46 PM
How do you create the launch daemon, and package it?
:(
Posted on 10-30-2015 02:37 PM
Quick rundown:
I recommend downloading a nice text editor (I use Textwrangelr).
http://www.barebones.com/products/textwrangler/
Paste the script below into a text editor
Drop the .plist into /Library/LaunchAgents, then drag it into Composer
Make a post flight script. Not needed if computer is restated
Package it as .pkg and upload to Casper Admin