This is actually a 2 part question, one for design decisions, and the other a technical question:
In our current network, we have Linux clients that authenticate against a server, and mount the user's network home, but keeping the real home separate. The network home is mounted using pam_mount, and is unmounted on logout. However, the real home area remains, so our current approach is to clear /home on boot.
I have been looking into alternate methods of performing this, and an interesting way would be to mount a tmpfs 'disk' as the user's home area, then unmount it on logout. This would ideally be performed using pam_mount also. I have run into problems attempting to get this to work, which are detailed below.
The 'original' clear /home on boot method, reliable, will generally always work, but might thrash the HDD/SSD due to many writes in the same areas. Current implementation is working fully.
The 'new' tmpfs volatile home area, which is unmounted on logout. Advantages include automatic cleanup of home areas, fast reads/writes, and no disk reads/writes. Also gives easy limiting to size of home area. Disadvantages are potential running out of memory, but also several problems that I experienced:
On a heavily modified Ubuntu 12.04 system using XFCE, mounting the tmpfs through pam_mount worked fine, but unmounting failed with a Device is busy error. The problems don't stop there though, since even after logging out and working as root attempting to manually unmount the home area gave the same error, even though fuser and lsof showed nothing using that directory. In fact, I asked about this problem on askubuntu.com.
Attempting to do the same thing on a more standard Ubuntu 12.04 still failed using pam_mount to unmount, but manually unmounting worked fine this time. Doing exactly the same with my Arch system worked, even with pam_mount doing the unmounting.
So there are two methods to doing this. Are there any other pros/cons to each method, which might want to make me choose one over the other? And why won't the tmpfs home area thing work properly!