10.5: Force FileVault to read Launch Services data

Mar 19, '08 07:30:03AM

Contributed by: Typhoon14

There is a fairly significant bug when using FileVault in Leopard that as of OS 10.5.2 is still not fixed. Basically, when using FileVault, the LaunchServices database is not read properly when you login to your FileVault account after a system restart (not just a logout/login — a full restart).

The reasons why it doesn't work are a little shaky, but basically, OS X fails to read the LaunchServices database and simply reverts to default settings. This means that any changes you make to the default applications -- changing your default web browser, RSS reader, FTP client, or changing which application files of a specific type are opened in -- will all be reversed as soon as you restart. The changes are, in fact, still present in the database, but they are not being read by the system.

Now, obviously, Apple needs to fix this ASAP, and I encourage everyone to submit a bug report on it. Until this happens, however, there is a fairly simple fix to force the database to be read on login.

To fix launch services, enter the following command in the Terminal:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
This command must be run on every login. You can easily automate this using Automator, however. Simply launch Automator and select the Custom starting point. In the Actions search field, type Shell script, and drag the Run Shell Script action into the workflow pane. Paste the above command into the script window, overwriting any text already there. Save the Workflow as an Application and put it anywhere (I put it in /Applications/Utilities). Now, go to Login Items for your account and add the application you just created to your login items. From now on, the script will be run whenever you login, and all changes to your LaunchServices database will be properly loaded.

Note: I cannot personally take credit for this tip. The workaround comes from a this thread on the Apple Discussion Forums. Please remember to submit a bug report to Apple, even if you don't use FileVault. Apple seems to assign FileVault-specific issues a fairly low priority, and they need to know this is unacceptable.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2008031217120475