This may be a stupid question because the act of installing the OS seems like it would prevent the Mac from sleeping in the first place, but because it's being done in the background for a cached installer (via self service) is it possible for the Mac to sleep while it's running?
I only ask because a couple times now, a Yosemite install from self service has failed because of a communication error, (request timed out) and that's typically caused by a Mac going to sleep which cuts the network connection. Of course it could be caused by something else but since these installs are being done remotely I can't watch them to see what's going on.
If the background install prevents sleep then sleep obviously isn't the problem, but I don't know what else would be causing a request time out that prevents the install from going forward. Anyway my question was regarding a way to keep the Mac awake while the install is going on, and I found that
caffeinate -s
works to keep the Mac awake, and
killall caffeinate
works to stop the process so it can go back to its normal sleep parameters. So I was wondering how to start caffeine, make sure that process stays running during the install process, and then kill it when the install is done. My thought was to set caffeine -s in Execute Command in Files & Processes in my Yosemite install policy, and then in the same policy add a "killall caffeine" script set to run After.
Even if none of this is applicable to my situation because it wouldn't be going to sleep while installing the OS in the background anyway, I'd still like to know if this would work because I don't understand the timing of the execute process command vs. running the kill script set to "after".
Like, even if the execute command runs right up front, at what point does the kill script run, when it's set to "after"? Like right after the execute command? Or does "after" mean after the install is finished and it's the last thing that runs before rebooting?
Thanks for whatever insight anybody has.