SLAC ESD Software Engineering Group
Stanford Linear Accelerator Center

Firefox Profiles

SLAC Computing
Software Engineering



All of the changes you make in Firefox, like your home page, what toolbars you use, extensions you have installed, saved passwords and your bookmarks, are all stored in a special folder, called a profile. Your profile folder is stored in a separate place from the Firefox program so that, if something ever goes wrong with Firefox, your information will still be there.




Since we use group accounts there will be profiles associated with each instance of Firefox running.  For the Operators in the ACR we use profiles associated by their workstation names.  For instance, if you start a Firefox session running on opi10, then the profile will be named opi10.  I use a wrapper script to run firefox and set the correct profile.  This way all Firefox instances will look the same, no matter which OPI you are running Firefox.


wrapper script: /usr/local/bin/firefox
firefox location /usr/lib64/firefox/firefox


If a profile is not provided with the firefox command ( ex: firefox -P opi10 ) it will pick the firest profile available.  I make "extra" profiles like, extra1, extra2, we have many profiles available for each user. Currently 40; extra1-40. 

The profiles are stored in ~/.mozilla/firefox/s893dejf9."profile name"  ( ex: ji0kceor.opi23 )

The main Firefox Profile files we preserve:


Stores customized user preference settings, such as changes you make in Firefox Options dialogs.
Contains all your Firefox bookmarks and lists of all the files you've downloaded and websites you’ve visited.
Stores information about which action is to be performed when downloading certain types of files, such as opening the file in a specific program or saving it to disk



Manaage Profiles


How I create the "master profile files" is on any OPI.  I first start up Firefox and configure it the way I want it to look.  I then close Firefox and copy the profile files, prefs.js, places.sqlite, and mimTypes.rdf to /usr/local/admin/firefox.  In this area I have Copy scripts to move the profile files to the users profiles.




In order to have your newly copied files active you must first stop Firefox and then upload files. If you copy over the files while Firefox is running, Firefox will overwrite your files when closed.  In the Copy scripts I check to see if Firefox is running and ask if you want to kill Firefox before copying files.  You cannot just kill any Firefox session to upload the files, make sure the operators are not actively using Firefox before killing.





When running the scripts the default is to copy the profile file to all accounts.  This is not how I run these scripts.  I usually run them by username and even username/profile to check the files first.  For example:

Users: acclegr physics eoicdesk pcds softegr ernesto jingchen flaci fphysics fsoftegr facclegr linac


./CopyPrefs  Copies over prefs.js to all users profiles
./CopyPrefs physics Copies over prefs.js to all physics profiles
./CopyPrefs physics opi10 Copies over prefs.js to physics profile opi10


The scripts also check for 2 files: lock and .parentlock.  If these files are detected it will ask the user if they want to kill the Firefox session.  Be careful as the Firefox session could be in use by the operators.


lock The most common cause of this error is that your Mozilla application did not shut down properly. It might still be running in the background (even though it's not visible) or it might have closed abnormally, without deleting the lock file. To avoid conflicts Firefox is designed to allow only one copy of the application to access a profile at the same time. This is done by checking for the existence of a lock file when it starts. If the lock file already exists, the application exits with an error message. Otherwise, it creates a lock file in the profile and deletes it at exit.
.parentlock This file tells firefox that the profile is already in use




If the Firefox setting aren't working or showing the changes you have applied - Or not startup

  1. When Firefox is up go to HELP -> Troubleshooting Information ---Click on Open Directory next to Profile Directory
    1. Make sure you are updating the right profile
  2. Check for lock files and .parentlock files when Firefox won't start
    1. These files will prevent Firefox from starting.  These files might be present if Firefox crashed or closed unexpectedly
    2. Delete these files for the profile in question

Worst case when copying files to profile and it is not showing the changes:  ( Delete profile and create new one )



  1. Startup Firefox with Profile Manager logged in as user
    1. For physics it would be:     /usr/lib64/firefox/firefox -ProfileManager
    2. This will bring up something like this


3. Select profile that is not working and delete

4. Click on Create Profile

Follow the steps to create a new profile with same name you just deleted

5. Go to /usr/local/admin/firefox and copy over prefs.js, places.sqlite, and mimeTypes.rdf

6. Bring up Firefox and test profile




[SLAC ESD Software Engineering Group][ SLAC Home Page]

Author: Ken Brobeck

Modified: 11-Dec-2018