Wednesday, August 12, 2009

Fixing Firefox 3 with Shared /home

Ok, I finally made the plunge at the office and am moving all of our workstations over to a system where the /home directory is shared via GlusterFS (www.gluster.org) and I use NIS for central authentication. Everything works beautifully, but today I came upon a very strange issue related to Firefox 3. It turns out the FF is known to have issues with shared /home directories since they moved to SQLite. I found bugs reported with NFS, AFS, GlusterFS, etc.

Here is my down and dirty fix. Basically a script on login sets up a /tmp/firefox-$USER folder and symlinks ~/.mozilla/firefox there. On logout another script copies everything in /tmp back to a folder at ~/.mozilla/firefox-sync. I am using this on Ubuntu Jaunty and these instructions are for it.

Step 1: sudo nano /etc/gdm/PostLogin/Default
#!/bin/bash

# move the .mozilla/firefox directory if there
if [ ! -L "$HOME/.mozilla/firefox" ]; then
if [ -d "$HOME/.mozilla/firefox" ]; then
mv "$HOME/.mozilla/firefox" "$HOME/.mozilla/firefox-sync"
fi
fi

if [ ! -d "/tmp/firefox-$USER" ]; then
mkdir "/tmp/firefox-$USER"
else
rm -rdf "/tmp/firefox-$USER/"
mkdir "/tmp/firefox-$USER"
fi

chown -R $USER:$USER /tmp/firefox-$USER

# copy the users files over
cp -rpdf $HOME/.mozilla/firefox-sync/* /tmp/firefox-$USER/

# create the link
if [ ! -L "$HOME/.mozilla/firefox" ]; then
ln -s "/tmp/firefox-$USER" "$HOME/.mozilla/firefox"
fi
Step 2: sudo chmod 755 /etc/gdm/PostLogin/Default

Step 3: sudo nano /etc/gdm/PostSession/Default

#!/bin/bash

#this moves all the data out of tmp back to the firefox.sync folder
if [ -d "/tmp/firefox-$USER" ]; then
rsync -a --delete /tmp/firefox-$USER/ $HOME/.mozilla/firefox-sync/
fi

Step 4: sudo chmod 755 /etc/gdm/PostSession/Default

I hope this helps someone out there that is trying to remedy this behavior on their network

2 comments:

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

Unknown said...

Hi Michael, have you filed a bug report at http://bugs.gluster.com about the sqlite problem? You can also write to vijay (at) gluster.com directly about this problem.