Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a server, which i access over ssh. Sometimes i like to run some scripts (some of them in the background) in tmux and then detach it, close the connection and access tmux later.
But unfortunately ecryptfs (or whatever service does that stuff) umounts my home-folder as soon as the ssh-connection is closed. This leads to several errors, because the scripts/deamons want to access some files in my home-folder.

So is there a way to prevent ecryptfs from umounting my home if there is still a (detached) tmux session running?

I know that i could just disable the encryption, but i would rather like to keep it and solve the problem someway else.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

One possibility is to deactivate automatic umounting:

  1. Go to the directory ~/.ecryptfs.
  2. You should find a file auto-umount there.
  3. Remove this file and your ECryptFS-folder will not be umonted at logout.

If you want to do it only at an existing tmux session, I'd suggest writing a small script:

#!/bin/sh

if tmux has 2> /dev/null; then
  touch ~/.ecryptfs/auto-umount
else
  rm ~/.ecryptfs/auto-umount
fi

If there is an tmux session the script deletes the auto-umount and if not it touches it. Place that script in your shell .logout file.

share|improve this answer
    
The script doesn't seem to work (i put it into the .bash_logout). But removing the ~/.ecryptfs/auto-umount is good enough for now. –  user121839 Jan 13 '13 at 4:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.