Commits

Oben Sonne committed f1b4326

Add information to automatically unmount on logout

Comments (0)

Files changed (1)

       -e, --edit           edit an EncFS item in keyring
       -r, --remove         remove an EncFS item from keyring
     ...
-    
+
 Usage should be straight forward - otherwise [submit an issue][7].
 
+### Automatically unmount EncFS folders on logout
+
+Unfortunately there's no equivalent to GNOME's autostart scripts which could be
+used to automatically unmount your EncFS folders on logout (without shutting
+down). However, there's a manual solution using a [GDM hook script][gdm]:
+`/etc/gdm/PostSession/Default`. Open this file in an editor (requires *root*
+privileges) and add this line:
+
+    mount | grep "^encfs" | grep "user=$USER" | awk '{print $3}' | while read MPOINT ; do sudo -u $USER fusermount -u "$MPOINT" ; done
+
+This script is executed whenever you logout from GNOME. With this line, it
+looks for mounted EncFS folders of the user currently logging out. Then it
+unmounts each, using the `fusermount` command (note that this command is
+executed as *root*, that's why there is a `sudo -u $USER` before the
+`fusermount` command).
+
+[gdm]: http://library.gnome.org/admin/gdm/stable/configuration.html
+
 License
 -------
 
 [1]: http://www.arg0.net/encfs
 [2]: http://live.gnome.org/GnomeKeyring
 [3]: http://bitbucket.org/obensonne/gnome-encfs/get/tip.tar.gz
-[4]: 
 [5]: http://dropbox.com
 [6]: http://www.gnu.org/licenses/gpl.html
-[7]: http://bitbucket.org/obensonne/gnome-encfs/issues/?status=new&status=open
+[7]: http://bitbucket.org/obensonne/gnome-encfs/issues/?status=new&status=open
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.