我有一个在MacOS10.5.8上运行的程序。该程序运行一个连续的周期,安装一个镜像,安装一个浏览器插件,然后再次卸载镜像。如果我让这个程序继续运行,我最终会遇到以下错误:"fork: resource temporarily unavailable“。在活动监视器中,我可以看到数百个名为diskimages-helper的进程正在运行。有谁知道为什么会发生这种情况,以及我如何避免这种情况?下面是我在程序的一个周期中使用的命令。
# 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发布于 2010-10-29 06:04:32
您需要始终分离磁盘映像--卸载它会卸载文件系统,但会将磁盘映像附加到/dev/ disk *条目,并运行diskimages-helper进程来处理它。请注意,hdiutil detach将为您卸载卷(前提是磁盘仲裁正在运行),因此您可以跳过卸载步骤。
https://stackoverflow.com/questions/4046019
复制相似问题