views:

13

answers:

1

Hi guys,

Ive got a program that runs on Mac OS 10.5.8. The program runs a continuous cycle where it mounts an image, installs a browser plugin and unmounts the image again. If I leave this program running I eventually end up in a situation where I get the following error "fork: resource temporarily unavailable". In the activity monitor I can see that several hundreds of processes called diskimages-helper are running. Does anyone know why this happens and how I can avoid it? Below are the commands I use during one cycle of the program.

// First I remove the plugin
rm -rf "/Library/Internet Plug-Ins/my.plugin"

// If the mount exists I unmount it
hdiutil unmount [mount] -force

// If that doesnt work I detach the device
hdiutil detach [device] -force

// Then I mount the image
hdiutil mount [image]

// I install the plugin
installer -package [package] -target /"

// Unmount
hdiutil unmount [mount] -force

// And if necessary detach
hdiutil detach [device] -force

Thanks, Bas

A: 

You need to always detach the disk image -- unmounting it unmounts the filesystem, but leaves disk image attached to a /dev/disk* entry, with a diskimages-helper process running to handle it. Note that hdiutil detach will take care of unmounting the volume for you (provided Disk Arbitration is running), so you can just skip the unmount step.

Gordon Davisson
Thanks for the answer, Ill give it a shot. (Its hard to say if it works as the problem sometimes takes days to manifest, its not like each cycle adds a diskimages process)
Bas Smit