Cannot open multiple instances of Firefox with xdg-open or kde-open5 in OpenSUSE due to “Firefox is already running” error

firefoxopensusexdg-open

When I try from the command line

$ kde-open5 http://unix.stackexchange.com/
$ xdg-open  http://unix.stackexchange.com/

… I get after a few seconds a dialog box on X11 telling me that Firefox is busy or not responding.

Also, when I click on a link from, say Thunderbird, I get the very same error, which seriously jeopardizes my workflow since, in this case, I have to manually copy/paste the link on a new tab created manually in Firefox.

Researching about the issue, I found similar questions suggesting that Firefox keeps a lock file which prevents multiple instances to open the same profile. Whilst it does make sense, my experience tells me that "it should work" since it always worked on several of my previous Linux installations and it works when I install Firefox by hand under /opt.

So… why Firefox is complaining? What is different with OpenSUSE which prevents Firefox from behaving like it always did when I was using other distributions? What is different with OpenSUSE which makes Firefox installed by zypper behaving differently from Firefox installed by hand (by simply expanding a .tar.gz file)?

Best Answer

I have circumvented the issue and now Firefox behaves as expected in comparison to other distributions and also in comparison to Firefox installed by hand. I don't really have a full explanation about root causes, but I have a solution for it, at least.

Investigating Firefox configuration

In my case I've found the following files:

$HOME/.mozilla/firefox/installs.ini:

[11457493C5A56847]
Default=jpxqfd4t.default-release-1609370879824
Locked=1

[F4BAF53E74A51272]
Default=jpxqfd4t.default-release-1609370879824
Locked=1

$HOME/.mozilla/firefox/profiles.ini:

[Profile0]
Name=default
IsRelative=1
Path=jpxqfd4t.default-release-1609370879824

[General]
StartWithLastProfile=1
Version=2

[Install11457493C5A56847]
Default=jpxqfd4t.default-release-1609370879824
Locked=1

[InstallF4BAF53E74A51272]
Default=jpxqfd4t.default-release-1609370879824
Locked=1

How to circumvent (or solve?) the problem

I've found these Locked=1 lines above suspicious. Without any basis for my actions, unless some guess and courage, I've decided to change these lines to Locked=0.

$ cp $HOME/.mozilla/firefox/installs.ini $HOME/.mozilla/firefox/installs.ini.OLD
$ cp $HOME/.mozilla/firefox/profiles.ini $HOME/.mozilla/firefox/profiles.ini.OLD

$ sed 's/Locked=1/Locked=0/' $HOME/.mozilla/firefox/installs.ini.OLD > $HOME/.mozilla/firefox/installs.ini.OLD
$ sed 's/Locked=1/Locked=0/' $HOME/.mozilla/firefox/profiles.ini.OLD > $HOME/.mozilla/firefox/profiles.ini.OLD

$ killall firefox

Problem solved.

Related Question