Unlockupd

Unlockupd works around a bug in lookupd, a system service which is required for proper operation of Mac OS X. If lookupd fails, the system quickly becomes unusable. Unlockupd periodically checks lookupd’s status and forces it to restart should it fail.

Unlockupd has undergone a significant amount of testing since July 2004, with no reported problems. Mac OS X 10.5 (Leopard) appears to have fixed the problem by eliminating lookupd altogether. Installing Unlockupd on Leopard should cause no problems, but it is not recommended, as it is not necessary.

Download

How to install

To install Unlockupd, run the installer package in the disk image.


How unlockupd works

Unlockupd is a small daemon which periodically polls lookupd. If it detects that lookupd is not responding, it makes a note in the system log and forces lookupd to terminate.

Technical Details

Lookupd is the lookup and caching daemon responsible for handling NetInfo, DNS, and other such requests on Mac OS X 10.0 – 10.4. Applications typically do not access lookupd directly, but rather, use standardized library functions (such as gethostbyname for DNS) which access lookupd on the application’s behalf.

Lookupd had a bug (rdar://3632865) in its cache cleanup code that causes it to randomly crash. CrashReporter, the system crash log agent, does not properly handle lookupd crashes, and as a result, when lookupd crashes, the process is not terminated. Since lookupd has not terminated, mach_init does not respawn lookupd. From this point, any application that attempts to access lookupd, either directly or indirectly, will hang.

Once lookupd stops responding, it becomes difficult, but not impossible, to recover the system to a usable state. One technique which works, but is not recommended (for obvious reasons), is to leave a root shell running and `killall -9 lookupd` when it becomes obvious that lookupd has died (sudo does not work, since it requires lookupd’s services, as does opening a new terminal window).

Mac OS X 10.5 does not use lookupd, so this problem does not exist, and the resolution provided by Unlockupd is not necessary.

How to uninstall unlockupd

You can uninstall unlockupd completely by executing the following commands on the command line, either using sudo, or from a user with the appropriate permissions:

sudo /usr/local/bin/unlockupd_remove


Version History

1.0.2 (February 23, 2009) – Minor changes to installer to make unlockupd install and work correctly. Add unlockupd_remove. GPL License.
1.0.1 (December 4, 2006 – unreleased) – Added better error reporting. Also attempt to kill crashreporterd if killing unlockupd was unsuccessful. Universal binary.
1.0 (September 26, 2005) – Documentation added to .dmg.
1.0b1 (July 2004) – First public version.