Difference between revisions of "Profile-sync-daemon"

From ArchWiki
Jump to: navigation, search
m (wording)
Line 3: Line 3:
 
[[Category:Daemons and system services]]
 
[[Category:Daemons and system services]]
 
{{Article summary start}}
 
{{Article summary start}}
{{Article summary text|{{AUR|Profile-sync-daemon}} (psd) is a tiny pseudo-daemon designed to manage your browser's profile in tmpfs and to periodically sync it back to your physical disc (HDD/SSD).  This is accomplished via a symlinking step and an innovative use of rsync to maintain back-up and synchronization between the two.  One of the major design goals of psd is a completely transparent user experience.}}
+
{{Article summary text|{{AUR|Profile-sync-daemon}} (psd) is a diminutive pseudo-daemon designed to manage your browser's profile in tmpfs and to periodically sync it back to your physical disc (HDD/SSD).  This is accomplished via a symlinking step and an innovative use of rsync to maintain back-up and synchronization between the two.  One of the major design goals of psd is a completely transparent user experience.}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Anything-sync-daemon}}
 
{{Article summary wiki|Anything-sync-daemon}}
Line 13: Line 13:
  
 
== Benefits of Psd ==
 
== Benefits of Psd ==
Running this daemon is beneficial for two reasons:
+
Running this pseudo-daemon is beneficial for two reasons:
 
#Reduced wear to physical discs
 
#Reduced wear to physical discs
 
#Speed
 
#Speed
Line 71: Line 71:
  
 
=== Using psd ===
 
=== Using psd ===
The initial synchronization will occur when the daemon starts.  Additionally, cron (if running) will call it to ''sync'' or update once per hour.  Finally, psd will sync back a final time when it is called to stop.
+
The initial synchronization will occur when the pseudo-daemon starts.  Additionally, cron (if running) will call it to ''sync'' or update once per hour.  Finally, psd will sync back a final time when it is called to stop.
  
 
==== Using SysVinit (Arch default currently) ====
 
==== Using SysVinit (Arch default currently) ====
  
Call the daemon to start, stop, or sync (restart) like any standard Arch daemon:
+
Call psd to start, stop, or sync (restart) like any standard Arch daemon:
 
  # rc.d <command> psd
 
  # rc.d <command> psd
  
It is ''highly'' recommended to start/stop the daemon at boot/shutdown.  This is accomplished by adding '''psd''' to the DAEMONS array in {{ic|/etc/rc.conf}} like so:
+
It is ''highly'' recommended to start/stop psd at boot/shutdown.  This is accomplished by adding '''psd''' to the DAEMONS array in {{ic|/etc/rc.conf}} like so:
 
  DAEMONS=(... @psd ...)
 
  DAEMONS=(... @psd ...)
  
Line 87: Line 87:
 
  # systemctl stop psd.service
 
  # systemctl stop psd.service
  
Enable the psd daemon to start/stop at boot/shutdown ''(highly recommended)'' using:
+
Enable psd to start/stop at boot/shutdown ''(highly recommended)'' using:
 
  # systemctl enable psd.service
 
  # systemctl enable psd.service
  

Revision as of 12:41, 27 September 2012

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Benefits of Psd

Running this pseudo-daemon is beneficial for two reasons:

  1. Reduced wear to physical discs
  2. Speed

Since the profile(s), browser cache, etc. are relocated into tmpfs, the corresponding onslaught of I/O associated with using the browser is also redirected from the physical disc to RAM, thus reducing wear to the physical disc and also greatly improving browser speed and responsiveness. The access time of RAM is on the order of nanoseconds while the access time of physical discs is on the order of milliseconds. This is a difference of six orders of magnitude or 1,000,000 times faster.

Supported Browsers and Caveats

Currently, the following browsers are auto-detected and managed:

  1. chromium
  2. firefox
  3. google-chromeAUR
  4. midori
  5. opera
  6. opera-nextAUR
  7. qupzilla
Note: Chromium actually keeps its cache directory separately from its browser profile directory. It is not within the scope of profile-sync-daemon to modify this behavior; users are encouraged to refer to the Chromium_Tips_and_Tweaks#Cache_in_tmpfs section of the main Chromium_Tips_and_Tweaks article for several work-arounds.

Setup and Installation

Profile-sync-daemonAUR is available for download from the AUR. Build it and install like any other package.

Edit /etc/psd.conf

Edit the included /etc/psd.conf defining which user(s) will have their profiles managed by psd.

Example:

# List users separated by spaces whose browser(s) profile(s) will get symlinked 
# and sync'ed to tmpfs.
# Do NOT list a user twice!
USERS="facade happy"
Note: At least one user must be defined.

Optionally uncomment the BROWSERS array and populate it with whichever browser(s) are to be sync'ed to tmpfs. If the BROWSERS array stays commented (default) then all supported browsers will be sync'ed.

Example: Let's say that both chromium and mirdori are installed but only chromium is to be sync'ed to tmpfs since the user keeps Midori as a backup browser and it is seldom used:

# List browsers separated by spaces to include in the sync. Useful if you do not
# wish to have all possible browser profiles sync'ed.
#
# Possible values:
#   chromium
#   conkeror.mozdev.org
#   google-chrome
#   mozilla 
#   midori
#   opera
#   opera-next
#   qupzilla
#
# Note that mozilla is the correct value for the firefox browser!
#
# If the following is commented out (default), then all available/supported 
# browsers will be sync'ed
BROWSERS="chromium"

Optionally redefine the location of the tmpfs mount to use for syncs. Do this in the VOLATILE variable. Note that for Arch Linux, the default value of "/tmp" should work just fine.

Using psd

The initial synchronization will occur when the pseudo-daemon starts. Additionally, cron (if running) will call it to sync or update once per hour. Finally, psd will sync back a final time when it is called to stop.

Using SysVinit (Arch default currently)

Call psd to start, stop, or sync (restart) like any standard Arch daemon:

# rc.d <command> psd

It is highly recommended to start/stop psd at boot/shutdown. This is accomplished by adding psd to the DAEMONS array in /etc/rc.conf like so:

DAEMONS=(... @psd ...)

Using systemd

Users making use of Systemd may manage the service using the systemctl command. Start/stop the service using:

# systemctl start psd.service
# systemctl stop psd.service

Enable psd to start/stop at boot/shutdown (highly recommended) using:

# systemctl enable psd.service

Sync at More Frequent Intervals (Optional)

Note: This step is NOT required. psd will update once per hour on its own thanks to /etc/cron.hourly/psd-update -- psd does NOT remain running in memory!

Users wishing to have syncs occur more frequently can simply add a line to the root crontab to call the sync function of psd like so:

# crontab -e

Example syncing all profiles being managed once every ten minutes:

 */10 * * * *     /usr/bin/profile-sync-daemon sync &> /dev/null

Support

Post in the discussion thread with comments or concerns.