251 | | == Hanging commands on Mountain Lion == #hangs |
252 | | Mountain Lion made some changes to CoreFoundation, such as the creation of the [http://developer.apple.com/library/mac/#releasenotes/CoreFoundation/CoreFoundation.html cfprefsd] daemon. This can cause some processes to hang for users who have logged in as root. |
253 | | A patch to solve this issue was committed in r104118 and is available to MacPorts users who are using trunk for their base. It will reach the rest of the MacPorts users once MacPorts 2.2 is released. In the meantime, users experiencing this issue can export `__CFPREFERENCES_AVOID_DAEMON=1` to their shell environment, and then add `__CFPREFERENCES_AVOID_DAEMON` to the environment variables to keep with the `extra_env` option in the user's `macports.conf` file. |
| 251 | == Hanging commands on Mountain Lion == #mtln-hangs |
| 252 | |
| 253 | '''Symptom''' |
| 254 | |
| 255 | Running MacPorts 2.1.3 or older under a root login shell on Mountain |
| 256 | Lion may hang indefinitely; this is due to |
| 257 | [http://developer.apple.com/library/mac/#releasenotes/CoreFoundation/CoreFoundation.html certain changes in CoreFoundation]. |
| 258 | A workaround has been [[changeset:104118|committed to trunk]] and will |
| 259 | be released in a future version of MacPorts. |
| 260 | |
| 261 | '''Workaround''' |
| 262 | |
| 263 | The recommended way to avoid this issue is to avoid running MacPorts in |
| 264 | root login shells. Non-login root shells are fine. |
| 265 | ||= =||= DO =||= DON’T =|| |
| 266 | ||= Non-interactive =|| `sudo port …`\\`su -c port …` || `su - -c port …` || |
| 267 | ||= Interactive =|| `sudo -s`\\`su` || `sudo -i`\\`sudo su -`\\`su -` || |
| 268 | |
| 269 | If you absolutely must use a root login shell, you can |
| 270 | 1. [[howto/RunningTrunk|run MacPorts from trunk]], or |
| 271 | 2. work around the problem by setting !__CFPREFERENCES_AVOID_DAEMON to “1” in the environment and configuring MacPorts to preserve it in macports.conf: |
| 272 | {{{ |
| 273 | extra_env __CFPREFERENCES_AVOID_DAEMON |
| 274 | }}} |
| 275 | Note that using `extra_env` is unsupported. |