Posted on 08-04-2020 06:17 AM
Hello everyone,
I'm using a tweaked version of the update script found on this forum. The tweaked version will detect if a macOS update requires a reboot, or a full shutdown.
In the even that a full shutdown is required, I run the command "shutdown -h +1". This command works great on my own Mac, and in my testing on a VM (both manually and through a Jamf policy).
I've since deployed this script to the first round of test computers, and in the log file I'm receiving the following on all of them:
shutdown: [pid 53833]
Shutdown at Mon Aug 3 22:12:57 2020.
shutdown: can't detach from console
It doesn't look like the shutdown is actually occurring, and I'm not finding much on Google for what "can't detach from console" means, or alternative methods of initiating a shutdown.
Has anyone seen this error before? Is there a different/better way to initialize a shutdown, or does anyone know what could cause this error?
Posted on 08-04-2020 11:32 AM
Try adding an ampersand ( &
) to the end of your command. This spins off the command to its own process and should allow the policy to complete its process. Something like:
shutdown -h +1 &
Posted on 08-04-2020 03:36 PM
A wise man named Bill once told us to use && shutdown
or && reboot
At the end of our script.
Posted on 08-05-2020 06:14 AM
Thanks for the suggestions, I will give them a shot.
EDIT: I went with the first suggestion of "shutdown -h +1 &". Although the result of the command is no longer returned in the Jamf log, this does appear to be working as I'm seeing the machines get successfully updated. Thanks again.