Ubuntu / Linux news and application reviews.

ram

Profile Sync Daemon is a tool to move the web browser profile to RAM, using tmpfs, which has the advantage of reducing disk writes (useful for SSDs, some would say), increased speed and responsiveness.

The tool supports most browsers: Chromium, Google Chrome, Firefox (stable, beta, aurora and firefox-trunk), Conkeror, Midori, Opera (including Opera Next) and Qupzilla and is based on an old script (we've covered it on WebUpd8 back in 2009), with some extra features: this is a daemonized script and has recovery protection, as well as support for all the above mentioned browsers as opposed to the old script which only supports Firefox. It's also a lot easier to use.

Since RAM content is cleared on reboot, Profile Sync Daemon automatically syncs the profile back to the physical disk using a symbolic link and rsync at a given time interval. Furthermore, the profile is synced back to the hard disk before you shut down or restart your computer, so no profile data is lost. Still, use it at your own risk!

By default, Profile Sync Daemon syncs all your browsers profiles in RAM, but this can be changed from its configuration file, along with some other options.



Install Profile Sync Daemon


Profile Sync Daemon is available for Ubuntu, Fedora, Arch Linux, Chakra Linux, Debian and Gentoo.

Before installing it, make a backup of your browser profile just in case!

Too install it in Ubuntu, use the following commands:
sudo add-apt-repository ppa:graysky/utils
sudo apt-get update
sudo apt-get install profile-sync-daemon

For Arch Linux, install it via AUR.

For other Linux distributions, see the Profile Sync Daemon GitHub page.

After the installation, you must configure it. The instructions below are for Ubuntu and may be different for other Linux distributions (I'll link to the Profile Sync Daemon Arch Linux wiki at the bottom of the article for more info). Open /etc/psd.conf as root with a text editor:
gksu gedit /etc/psd.conf

then scroll to USERS="" and add your username, example:
USERS="andrew"

Save the file but don't close it - just switch to a terminal and run the following command:
profile-sync-daemon parse

This should display all the browser profiles Profile Sync Daemon can sync to RAM. Now that you know all the browsers / profiles available on your system that this tool supports, go back to the text editor where you were editing /etc/psd.conf, scroll down to #BROWSERS="", uncomment it (remove the "#") and add the browsers for which you want to mount the profile in RAM (if they showed up when running "profile-sync-daemon parse"), separated by spaces. Examples:
BROWSERS="firefox"
or:
BROWSERS="firefox chromium"

If you don't uncomment this, all the supported browser profiles will use tmpfs.


See if you need to change anything else in this file (you usually don't need to change anything else because the VOLATILE path is automatically set based on the Linux distribution used, so it's set to /run/shm by default in Ubuntu), then save it.

Now you need to close the browsers added to /etc/psd.conf - make sure they are not still running! - and start the Profile Sync Damon:
sudo service psd start
That's it.


Optional: more frequent syncs to disk. By default, Profile Sync Daemon runs every hour (using a cron.hourly job) and syncs your browser profile(s) to the disk, but if you want more frequent syncs, you can add a cron job:
crontab -e
And add this:
*/5 * * * *     /usr/bin/profile-sync-daemon sync &> /dev/null

The above line will sync your browser profile(s) to the disk every 5 minutes, but you can change this to anything you want (for more info, see the Cron howto).



How to check if Profile Sync Daemon is working


tmpfs browser profiles /run/shm

To see if Profile Sync Daemon is working and your browser profile is using tmpfs, you can navigate to /run/shm (in Ubuntu; on Debian it should be /dev/shm) and see if your profiles show up there. You can also check your browser profile directory (e.g.: ~/.mozilla/firefox) to see if the profile folder (e.g., for Firefox, it's usually called 123456.default, where 123456 are some random letters / numbers) is now a symbolic link to a folder in /run/shm.


Further info: