Policy .dmg not unmounting after execution

lps
New Contributor

Hello everyone,

platform: 10.11.5/6 , iMac, MacBook Pro/Air

We are running into a situation where a jss deployed .dmg from a policy remains mounted on the desktop after completing execution. In this case it is a policy that deploys a dock.apple....plist file to the users home library followed by : killall cfprefsd, killall Dock; in the Files and Process section of the Jss policy.

I did some digging and found that running:

FinderPID=$(ps axco pid,command | grep Finder | awk '{print $1;}')
kill $FinderPID

does in fact restart the finder but the dmg image does not unmount.

I then tried appending "umount /Volumes/mountedimagename" to the 'Files and Processes' section of the policy in the JSS and saw that it will unmount the dmg, but then the policy fails as AppleDockFixUp reloads the default dock - which it did not do before appending the above mentioned command after killall cprefsd; killall Dock; in 'Files and Processes'.

We're grateful for any suggestions/experience others have had in this area.

Sincerely,
LPS

4 REPLIES 4

lps
New Contributor
 

millersc
Valued Contributor

Test this snippet. It's used in some scripts for auto updating software.

mntpoint=`diskutil list | grep SOFTWARE_TITLE | awk '{print $X}' `
hdiutil detach $mntpoint -force -quiet

SOFTWARE_TITLE = what ever your software name should be. eg VLC or Adobe
$X = which column the "diskxsx" turns out to be for above. Could be 6 or 7, depends on the name length.

You can also just use the second line after you know what the first line is with testing and use with Files and Processes.

Hope that helps.

lps
New Contributor

Thanks MillersC. I tried it but still no joy.

sdagley
Esteemed Contributor II

Just to be clear, you're talking about a .dmg that you created with Composer that contains your dock...plist and that .dmg is the source for an Install action for a Packages payload in a policy?