If at all possible, I would suggest that auto-mount/unmount keep a counter file in the ~/.ecryptfs directory, ++counter when the user logs in, --counter when logs out, unmount only if counter == 0.
I guess there could be side effects when a session crashes, leaving the counter in a bad state. That could be circumvented with a cleanup procedure invoked at stratup, maybe?
If at all possible, I would suggest that auto-mount/unmount keep a counter file in the ~/.ecryptfs directory, ++counter when the user logs in, --counter when logs out, unmount only if counter == 0.
I guess there could be side effects when a session crashes, leaving the counter in a bad state. That could be circumvented with a cleanup procedure invoked at stratup, maybe?