Install macOS Mojave - Self Service fails to quit

jkaigler
Contributor II

For testing Mojave mac refresh, i have 2 policies in Self Service. The first download the installer to /Applications. The second policy runs "/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall" --eraseinstall --newvolumename "Macintosh HD" --agreetolicense &

This worked during my original tests, but lately Self Service fails to quit. I can manually close Service and everything works as expected afterwards.

I think I have seen other posts about this, but my searches have come up. blank

We are on JAMFPro 10.8 and testing with 10.14.1

7 REPLIES 7

c_kay
New Contributor III

I use this:

selfService=$(pgrep "Self Service"); /Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --eraseinstall --newvolumename "System" --agreetolicense --rebootdelay 5 --nointeraction --pidtosignal "$selfService"

Look
Valued Contributor III

Here is what I made for this, modify to suit.
This checks for Mojave, failing that checks for High Sierra.
What it doesn't currently do is check if the installer is a stub and full installer (it will fail if it's a stub).
It also has a check where the target drive has to be named WIPE before it will proceed.
The Self Service Issue is dealt with by simply force quiting Self Service first.

#!/bin/bash
Volume_Name=$4
if [[ "$Volume_Name" == "" ]]; then
    Volume_Name="Macintosh HD"
fi

Boot_Volume=$(diskutil info / | awk '/Volume Name:/ {print $NF}')
if [[ "$Boot_Volume" == "WIPE" ]]; then
    osascript -e 'tell application "Self Service" to quit'
    if [ -d /Applications/Install macOS Mojave.app ]; then
        /Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS Mojave.app --eraseinstall --newvolumename "$Volume_Name" --agreetolicense --nointeraction
    elif [ -d /Applications/Install macOS High Sierra.app ]; then
        /Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS High Sierra.app --eraseinstall --newvolumename "$Volume_Name" --agreetolicense --nointeraction
    else
        echo "No installer found"
    fi
fi

itupshot
Contributor II

How are you creating the admin account after an --eraseinstall of Mojave? Do we now have to manually create the account when the machine reboots?

This just seems like a big step back. JAMF Imaging running on a NetInstall image helps automate this, but if we now have to launch the macOS Installer, and wipe the computer, it'll no longer get any instructions from JAMFPro.

How are you guys dealing with this step? I haven't migrated our computers to Mojave because I'm missing this key piece of the imaging process. Upgrading is easy because there's no wiping of the HD, but a complete fresh install is an issue.

jkaigler
Contributor II

@itupshot if you use Apple's DEP, the device can automatically enrolled in JAMF server. I am still in testing on mine but it seems to work pretty good. I am having an issue of getting devices in DEP, I'll probably have to call Apple and see if they can help.

tjhall
Contributor III

@itupshot If the Mac is already on 10.13.4 you can add additional packages in the wipe command process. This means you can (for example) add a quickadd package in the installation procedure (the packages needs to be signed though)
If it's not DEP you are required to manually approve the MDM profile though.

msnowdon
Contributor

Thank you @c.kay Ive been trying to get this to work for several days now. I tried every variation of the startosinstall command but just wouldnt run. Im not a scripter so could you explain to me the selfService=$(pgrep "Self Service") and --pidtosignal "$selfService" parts? Does that killing the Self Service app or telling it something else?

Thanks

Mark

john_sherrod
Contributor II

@jkaigler I was having the same issue and what fixed it for me was unchecking "Ensure that users view the description" in the Self Service section of the policy. That was apparently causing it to hang and not quit Self Service properly. As far as I know I haven't had the issue since I made that change!