23

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?

  • Is there a killall command on Cent OS? That one you can use to kill by name, as you tried before. – manatwork Jun 8 '13 at 10:54
  • 3
    Yes there are the standard commands such as pgrep, pkill, and killall. – slm Jun 9 '13 at 0:55
  • CentOS is a Linux distro, not Unix. – Rafael Cavalcanti Jun 9 '13 at 16:18
  • Dchris - Please remember to accept which answer worked for you, or ask for more information. – user66001 Jun 9 '13 at 20:22
  • Dchris - No-one. – user66001 Jun 9 '13 at 21:40
27

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.

  • 2
    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
17
  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)
  • @don_crissti much better! – Dchris Jun 8 '13 at 10:44
  • 8
    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.

  • 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
  • -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.

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).

  • 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.

  • -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

protected by Community Apr 6 '17 at 16:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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