Wednesday, January 27, 2010

"Unlocking" Firefox or Thunderbird sessions

Usually, I store my work on my shared local network. This has many obvious advantages, the primary being: I have access to all my files from everywhere, and not just my desktop machine. A peculiar problem that I run into very frequently, when I try to launch Firefox (esp. during lectures which take place in a different lecture hall) is a dialog box which says:

This happens because I usually leave Firefox running on my Desktop, when I go to the lecture hall. This source explains the problem:
Some applications (e.g. firefox, eclipse and more) use lock files to prevent users from opening two instances of the same application. A lock file is usually a simple file named "lock" or ".lock".

The application creates the lock file when it starts, and deletes it when it exits. When it crashes, it might forget to clean up the lock files, and when it is re-opened, and finds the lock files, it thinks there is already an instance running, and as a result, refuses to open.
On a linux box, the solution is relatively straightforward:

1. Go to the .mozilla/firefox, ./thunderbird, or ./mozilla-thunderbird directory
2. There is often a directory "X" which ends with ".default". cd into this directory.
3. Remove the "lock" file.
4. Of course, when you delete the lock, the session that the lock is protecting will probably crash.

No comments: