I need to clear tmpfs after each logout from system (Ubuntu x86_64).
1 Answer
Take a look at pam-tmpdir and pam-mount.
pam-mount mounts and unmounts directories when PAM sessions are started and finished (which includes when users log in and out).
pam-tmpdir creates a user-specific temporary directory each time someone logs in, which may come in handy if you're trying to isolate users from each other.
Note that in any case there may be daemons which have files in /tmp that they expect to keep around longer than a user's session; so I'd recommend going with a user-specific temporary directory, using either pam-mount or pam-tmpdir.
- Thank you, this is what I need. But i don't found a this packages for x64 architecture (Ubuntu 14.04).user77451– user774512015-03-25 05:22:25 +00:00Commented Mar 25, 2015 at 5:22
- In Debian and Ubuntu, the packages are respectively
libpam-tmpdirandlibpam-mount.Stephen Kitt– Stephen Kitt2015-03-25 05:36:11 +00:00Commented Mar 25, 2015 at 5:36
grep '^tmpfs' /proc/mountsumount/mount("remount") will not clear the file system, it will just "disconnect"/"reconnect" it from/to the file system hierarchy.