31

I am trying to open Firefox in CentOS, but I'm getting the following message:

Firefox is already running but is not responding

and Firefox doesn't open. I tried this in command line:

kill Firefox

but it didn't work. Also, I don't know in which directory I must execute the right commands.

How can I fix this?

38

From http://kb.mozillazine.org/Profile_in_use - Check for:

1) A file called .parentlock
-AND-
2) A symlink called lock
...in ~/.mozilla/firefox/random string of alphanumeric characters.default/

The former is present while Firefox is running to prevent more than one different instance from trying to simultaneously write to the same set of profile files, and if Firefox is not closed cleanly, neither may be removed.

Error message received in this case should be:

From anywhere in the filesystem (or removing this if pwd reports ~/.mozilla/firefox/random string of alphanumeric characters.default), replacing random string of alphanumeric characters with the FF profile folder on your computer, do rm ~/.mozilla/firefox/random string of alphanumeric characters.default/.parentlock ~/.mozilla/firefox/random string of alphanumeric characters.default/lock` (assuming the first sentence pans out) to remove them, if there isn't a Firefox process running.

More less-authoritative information here.

| improve this answer | |
  • 4
    This solution is still valid after almost 4 years (just tested with Firefox 53 on Ubuntu 17.04). Thanks! – Vanni Apr 26 '17 at 14:26
  • Should be the answer. I had the problem when another user had logged into firefox, so I couldnt kill the PID.. I had to remove these files.. – dermen Aug 7 '17 at 3:00
  • 1
    Blind one-liner: rm ~/.mozilla/firefox/*.default/{.parentlock,lock} – Neapolitan Jan 9 at 22:04
  • for me the directory was named *-default rather than *.default – axolotl Feb 28 at 16:45
21
  1. First find the process id of firefox using the following command in any directory:

    pidof firefox
    
  2. Kill firefox process using the following command in any directory:

    kill [firefox pid]
    

Then start firefox again.

Or you can do the same thing in just one command.As don_crissti said:

kill $(pidof firefox)
| improve this answer | |
  • @don_crissti much better! – Dchris Jun 8 '13 at 10:44
  • 10
    Or better still is pkill firefox. – slm Jun 9 '13 at 0:57
  • If doesn't work, try kill -9 $(pidof firefox) or pkill -9 firefox – mavillan Sep 4 '13 at 14:38
  • From experience, -9 is almost always recommended. – schaiba Feb 25 '16 at 10:18
  • NOTE: The above will not allow Firefox to perform closing operations (like the other pkill/kill options discussed elsewhere on this question, will, as they currently are) and will lead to (amongst other things) the lock symlink not being deleted, which will cause the message in this question to remain. See my answer for more details. – user66001 Apr 26 '17 at 18:17
4

Usually, many users say this command helps:

killall -SIGTERM firefox

The killall command will killall processes that are named "firefox". SIGTERM is the kill-signal type. This command works well for me and other Linux users. Also, it may help to wait thirty seconds after closing Firefox before it is turned back on.

| improve this answer | |
  • 5
    Not really. killall matches the pattern exactly. What you said is valid for pkill: it kills all processes containing that pattern (unless you pass -x in the arguments). For instance, "pkill refox" will kill firefox, but "killall refox" won't do anything (unless you have a "refox" process running). – Rafael Cavalcanti Jun 9 '13 at 16:14
  • NOTE: The above will not allow Firefox to perform closing operations (like the other pkill/kill options discussed elsewhere on this question, will, as they currently are) and will lead to (amongst other things) the lock symlink not being deleted, which will cause the message in this question to remain. See my answer for more details. – user66001 Jun 11 '13 at 19:55
2

open a terminal and enter:

firefox -P

Or using a shell scipt:

#!/bin/bash
files=`find ~/.mozilla -name "*lock"`
for file in `echo $files`
do
  echo "removing $file..."
  rm "$file"
done
| improve this answer | |
  • -1 firefox -P prompts for profile to load, which isn't the issue here. The shell script will remove the files at issue here (hopefully not others in any past/future version of Firefox also). Remove the first suggestion. – user66001 Apr 26 '17 at 18:13
1

If none of the above works, make sure your Firefox profile is owned by your user and not, say, by root. I got this exact error after I copied my profile over from somewhere else, forgetting that I was running in a root shell at the time.

| improve this answer | |
0

If you don't find any firefox instances running when you search with pgrep or htop, and want to force restart your firefox, just delete the profiles.ini file and restart firefox.

Caution: Do this if you do not care about profiles. The file can be found in ~/.mozilla/firefox/ (if this profiles.ini does not make any sense to you, you can go ahead and delete).

| improve this answer | |
  • Or you can change profiles.ini file permission to 777 – kavi temre Aug 8 '16 at 10:05
  • -1 Where is the documentation that profiles.ini prevents Firefox from starting with the OP's stated error message? – user66001 Apr 26 '17 at 18:11
0

A really easy way is to just open a terminal, run firefox -P, and either delete the user profile that won't run or to just create another profile and set that as your default one.

| improve this answer | |
  • -1 If one doesn't care about browsing history, cookies, bookmarks, or anything that happened in previous browsing sessions, this would be a solution. But for the rest of the world this is akin to replacing your new car when it needs a new tire. – user66001 Apr 26 '17 at 18:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.