Hey All -
I'm running into a weird issue where during testing, I had my upgrade workflow to get our computers upgraded to the newest version of Monterey via a pkg file. All went perfectly during testing. However, when I pushed it live this morning, all users received this error that the process was killed when it attempts to call startosinstall:
"/Library/Application Support/JAMF/tmp/upgradeRebootWarning.sh: line 20: 60521 Killed: 9 /Applications/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --nointeraction Error running script: return code was 137."
For reference, this is all the script is doing:
#!/bin/bash
#get logged in user info
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
loggedInUserUID=$(id -u "$loggedInUser")
echo "The current logged in user is $loggedInUser and their UID is $loggedInUserUID"
#create applescript string
userPopup="display dialog \\
\\"Your machine has finished the download and will need to reboot in order to begin the macOS upgrade process. Please save all work you may have open and keep your computer plugged into power throughout the duration of the upgrade.\\n\\
The upgrade will begin after clicking the OK button. It can take upwards of 30 minutes before the reboot occurs while the installation happens.\\" \\
buttons {\\"OK\\"} \\
default button \\"OK\\""
#call applescript for user popup
upgradePrompt=$( /bin/launchctl asuser $loggedInUserUID sudo -u "$loggedInUser" /usr/bin/osascript -e "$userPopup" )
#gather user input information
echo $upgradePrompt
/Applications/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --nointeraction
Any idea why this would happen after it was working perfectly just days before, without any changes to the policies or script?