Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using pam_mount to mount user home areas as tmpfs on login, and to unmount the area on logout. The line in question in pam_mount.conf.xml is as follows:
The mounting part works - the user gets their home area with correct permissions and correct size for them to use. The problem is with unmounting on logout. The home area stays mounted after logout, and looking in auth.log pam_mount says that the device is busy, and thus it was unable to unmount. But the problems don't stop there - trying to unmount the area manually as root also fails due to the device being busy. I have checked with fuser and (at least with the best of my ability) using lsof, and no files are open within the home area. The only way I can get it to 'unmount' is to do a lazy unmount, but even that isn't a real unmount. Forcing unmount has no effect either.
My first thoughts were that tmpfs was somehow bugged, but this was disproven since adding another line to mount a tmpfs somewhere other than the home area works fine. I have tried using the logout kill option in the configuration to kill any processes that might still be running, but also to no avail. And now, at the end of my rope, I come here in the hopes of finding a possible solution.
System specs:
(X)ubuntu 12.04, heavily customized XFCE desktop, LightDM with KDE greeter, fully updated until a few days ago. Running on an SSD, using open-source graphics drivers.
Alright, I did a bit more testing on this. I disabled the pam_mount tmpfs line, and mounted a tmpfs as my home area (all of this done while logged in as root). I then logged out of root, logged in as myself (everything working OK with regards to the desktop), then logged out again and back in as root. Attempting to umount the home area again gives a device is busy error. I tried deleting everything inside the home area and trying again - still no joy. Yet again, the only thing that can successfully unmount the tmpfs is a lazy unmount.
I used the following specific commands:
Code:
mount -t tmpfs -o uid=1000,gid=1000,size=100m,mode=0700 none /home/user
(at this point I logged in as myself)
umount /home/user
Now that pam_mount has been ruled out, this thread is a general question of why does a home area mounted as tmpfs not allow itself to be unmounted again properly? Unfortunately I cannot find a way to change the title of this thread - perhaps a mod could do that?
EDIT: I have narrowed it down further - logging in though a virtual terminal does not 'corrupt' the tmpfs, while logging in though an X session does. I uninstalled gvfs just in case it was the culprit (these kinds of things usually are) but it was not. Anything else to try, short of uninstalling all graphical apps?
EDIT2: The mystery deepens. Doing the same thing on my Arch Linux install (again with XFCE) the unmounting worked just fine. I am now struggling to understand what is causing these problems.
Last edited by colucix; 01-31-2013 at 04:58 AM.
Reason: Two posts from the OP merged: thread sent back to Zero Reply List
I realize that this article is How To keep the directory mounted but perhaps by learning how it's kept mounted we can be enlightened to the reversal of what you have going on. http://ubuntuforums.org/archive/inde...t-1694953.html
Maybe it's a encryption/decryption issue to be able to mount and 'unmount'
Thanks for replying! I thought this thread might die into oblivion. To answer your questions:
The home area is not encrypted. I have tried using fuser and lsof to find open files, but still nothing. However, on a different Ubuntu install (still using XFCE, but the Unity greeter) the process works fine.
By tmpfs I mean a 'tmpfs' type volume that acts as a ramdisk. The idea would be that the user's home area would be on a ramdisk, thus be volatile and lose all changes on logout, but also fast due to it running off the memory.
Could the fact that I use Winbind authentication change anything?
Do a "fuser <mountpoint>" when it hangs. It will show you what processes still have it open.
In the past, I have found that some desktops (gnome3/cinnamon/kde) leave processes hanging around after logout. These would prevent you from dismounting.
Another thing - remember that some desktops also use fuse mounts within the users home directory. So a "mount" listing might show these hanging around as well, and that too would prevent a dismount.
Try what jpollard; has recommended and I'll investigate 'Windbind and it's Authentication'
Authentication Methods (there are more than one kind)
- The balanced password with key exchange
- The Augmented password; key exchange password authenticated key retrieval
- Multi Server Methods and the Multi Party Methods
Using Windbind shouldn't be a problem as it is part of the Samba 7 suite.
The only thing I found is that turning off user enumeration maycause some programs to behave oddly-
If you do suspect that Windbind could be causing conflict the Windbind log should provide you with some clarification. Read through the log and see if you find something odd.
Found a bug with Windbind and Ubuntu but it was in 2010
Occasionally on various Ubuntu 64-bit LucidLynx systems (10.04.1), winbind goes into a state such that logging in fails. https://bugs.launchpad.net/ubuntu/+s...ba/+bug/667269
I have already tried the fuser thing (and lsof) but to no avail. mount shows no FUSE filesystems mounted within the home area, and there are no processes running as me after logout. However, I will look into the Winbind links.
I will test once more on a slightly updated system, but it would be nice to know exactly what to try to find the problem - perhaps the Ubuntu guys could give some answer on that? For reference, the exact procedure is as follows:
Assume a user, 'testuser' can be authenticated through Winbind, which is connected to a Samba3 domain. This user has a home area defined as /home/testuser
Log in as root on the machine, and create /home/testuser, then run
Code:
mount -t tmpfs -o size=100m,uid=[testuser-uid],gid=[testuser-gid],mode=0700 none /home/testuser
Logout as root, and log in as testuser.
Logout as testuser, log in as root.
Attempt to unmount /home/testuser - this fails for me with 'Device is busy'
An important thing to note is that logging in through the graphical interface causes the problem, while logging in only through a virtual terminal doesn't. As mentioned before fuser and lsof do not show anything using that directory. The machine had GVFS uninstalled, however even with it installed there was no change. Repeat of the specs: XFCE desktop, LightDM with KDE greeter, Ubuntu 12.04.
At the moment I have defaulted back to our previous method of simply clearing /home on boot, but getting tmpfs to work properly will be really cool, especially if it can be linked with pam_mount to give automatic mounting/unmounting of the home area on login/logout.
Good news; I posted a thread on your behalf; in the Ubuntu Forum-
- I explained the details and spec's about your system and they know now all of what you have tried-
I should hear from them in a few days but a 'heads-up' if they require me to provide them with your systems output of commands that need to be executed this could get complicated so I would need you to be prompt and answer as soon as your able to.
As soon as one of the Ubuntu Members or Forum Staff answer me I'll let you know what they have to say and what they think-
Thank you so much for this! Getting system information quickly may be an issue - I may be able to get a copy of the OS running at home on a virtual machine, but if I can't then it's weekdays only. Still - since this will ultimately benefit me I will try my best.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.