autofs unmounting at logout

How do you get autofs to unmount the users home directory at logout

I thought it did it automatically but if I log in several users on a machine one after another
all the home directories are still mounted ( users cant go into any one but their own but
mount shows them all there. ) and they never unmount until you reboot

Ta

Mal

On 09/05/2012 05:06 PM, interele wrote:
> and they never unmount until you reboot

is that a problem?
how or why?


dd

We have some issues with some machines being very slow to log on and applications freezing for minutes
( particularly firefox )

I am currently at a bit of a loss as to why. I am going to try going back to nfs3 tomorrow and see what happens
I discovered that the iMacs attached to the same servers perform really really badly when I used nfs4 but positively
flew when I used nfs3 homes directories.

Apart from that I was wondering if the server having to cope with half a dozen mounts from each machine
is causing it to run out of steam. We have only a few more machines up and running as we had in the system
tests the only difference is that during the tests very few people logged on consecutively between reboots
now there are up to ten per machine. I have looked at nsfstat, netstat watched the system monitor and the
server doesn’t seem stressed but it has a hell of a lot of connections. I have tried varying numbers of nfsd
processes and that makes no differece. Setting the mount to r and w size to 32768 improved things a bit but
nothing to write home about

Any ideas ?

Mal

On 09/05/2012 07:46 PM, interele wrote:
> Any ideas ?

ANYONE else who can help, PLEASE do!!

if it is Firefox 15 there are numerous reports of supremely flaky
behavior, here
http://forums.opensuse.org/english/get-technical-help-here/applications/477901-firefox-15-0-keeps-crashing.html

so, for now don’t let it cause you to try to fix a problem with your
end-to-end system…

i have to admit i have no idea on the (probable) networking
problem…i think a mounted user /home which is not being exercised
(because that user has logged out from the system) should not case the
server to “run out of steam”… but, i don’t know that for a fact.

OH!! both Gnome and KDE (i do not remember which you chose) have some
kind of “desktop indexer” … (the terms Akonadi and Nepomuk come to
mind) those are well know hogs which root around indexing desktops so
the unorganized can find their ‘stuff’…i’d guess if you have multiple
copies of those running trying to index 50 or 200 students desktops you
are gonna need a Cray to stay nimble…

they can suck the resources right out of a system and block log in, or
log out, or firefox launching or or or…

top/atop/htop/ntop should help find the resource sucker.


dd http://tinyurl.com/DD-Caveat http://tinyurl.com/DD-Hardware
http://tinyurl.com/DD-Software
What does DistroWatch write about YOU?: http://tinyurl.com/SUSEonDW

I ran top and the ‘top’ 4 or 5 entries are nfsd

Mal

I hope an autofs expert jumps in here, I have not much experience. From
what I quickly read now on the arch wiki, autofs is simply not designed
to unmount on logout but has an optional --timeout parameter for the
file /etc/auto.master to unmount after a certain amount of inactivity.
https://wiki.archlinux.org/index.php/Autofs
I would try to set that to let’s say 600 seconds or so that latest 10
min after logout the automatic unmount appears, you may want to play
with that value.

Maybe that helps.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

I edited autofs on a couple of machines and set the time out to 300 to see what happened
and nothing did - it never unmounted

I am currently thinking it’s either dd@home’s thoughts on KDE’s indexer or I still like the idea of nfs4
being the culprit, particularly after the experience I had with the iMacs. I will go in at the crack of dawn
tomorrow and experiment! I have been looking at KDE’s forums and there seems to be no option to select
‘machine friendly’ indexing over ‘bat **** crazy’

I’ll look at this forum first thing in the morning - then post back how my experiments go

Many thanks everyone

Mal

Am 05.09.2012 22:06, schrieb interele:
> I am currently thinking it’s either dd@home’s thoughts on KDE’s indexer

The indexer for a particular users home cannot run when the user is
logged out since there is no longer a KDE session for that user in which
it is running. The indexer stops at logout from the graphical session
and is started again after login.
Of course dd’s post contains a good idea thinking alone about all the
indexing taking place when only a subset of users is logged in.
Just disable nepomuk on all the machines that’s just a user setting in
KDE. i am not sure how you can lock that setting so that it cannot be
enabled again, but I am sure there is a way.

Have you double checked that the users really log out and are not just
switching user sessions so that multiple users are logged in at the same
time from the same machine?
The fact that your automounts never unmount themselves bugs me.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

On 09/05/2012 10:25 PM, Martin Helm wrote:
> The indexer for a particular users home cannot run when the user is
> logged out since there is no longer a KDE session for that user in which
> it is running. The indexer stops at logout from the graphical session
> and is started again after login.

hmmmmm, that makes sense…and, assuming there is no indexer running
on the servers containing the various /home/[student_ID] directories–it
isn’t an indexer caused problem…

> The fact that your automounts never unmount themselves bugs me.

me too, but (again) how does a partition being mounted affect anything,
if that partition is not being hit?

WAIT!! why would each user need to have a unique mountable partition,
anyway!?


dd

Am 06.09.2012 11:31, schrieb dd@home.dk:
>> The fact that your automounts never unmount themselves bugs me.
>
> me too, but (again) how does a partition being mounted affect anything,
> if that partition is not being hit?
>
It points to a deeper problem if that standard feature does not work,
that is what bugs me.

> WAIT!! why would each user need to have a unique mountable partition,
> anyway!?
That is a really good question. It should be good enough and safe just
to mount /home and make the user directories mutually unreadable, I
understand that interele already took measures for that last part.
Even if that is not what is wanted in the end it would be worth a try to
see if that makes a difference.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Are you using direct or indrect mounts? post your /etc/auto.master and any other files it points to. Indirect mounts can mount each home directory as a single mount ie /home/user1 where a direct mount usally mounts the entire /home.
I have found the in openSUSE the aufofs never times out and behaves as if the mounts are in the fstab. Also if anyone is in the mounted directory it will stay mounted until the user is out of the directory. I haven’t dug into this to find out what is keeping the directories mounted enough and it doesn’t cause a problem on a home system,

On 2012-09-06 11:31, dd@home.dk wrote:

> me too, but (again) how does a partition being mounted affect anything, if that partition is not
> being hit?

It is a resource that is in use and does not need to. If you have hundreds of users it has an impact
on the server.

For example, if you need to reboot the server, it is preferable to see 5 mounted shares that a
hundred, of which only 5 are actually used.

> WAIT!! why would each user need to have a unique mountable partition, anyway!?

It is one of the tricks done when home is remotely mounted via nfs. You do not need to mount home
for a user or several users on boot, you mount it exactly when needed. And a refinement is use
different homes for each user, auto-exported separately, I don’t remember why.

There was a thread about this in the opensuse mail list (search for Lynn, IIRC)


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

On 2012-09-05 22:25, Martin Helm wrote:
> Am 05.09.2012 22:06, schrieb interele:
>> I am currently thinking it’s either dd@home’s thoughts on KDE’s indexer
>
> The indexer for a particular users home cannot run when the user is
> logged out since there is no longer a KDE session for that user in which
> it is running. The indexer stops at logout from the graphical session
> and is started again after login.

Maybe not. Often when loggin out of gnome and checking from a VT I see still running processes of
that user running. A pulse process and some others: they vary from release to release, they solve
some and create new ones.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

In answer to the various points/questions posted

I have 2 (very big ( although not Crays :wink: dd@home )) servers
File1
/home/
user1
user2

File2
/home/
user3
user4

Each server has about 600 home directories ( these are the ex Windows 2003 servers that serviced the same number of
users ( I added a better raid controller and 12Gb of ram ) and I just export /home on both. /home *(rw,async,no_subtree_check)

Question :- in this scenario should I have no_subtree_check ? I have heard some people say sub tree checking is more trouble
than it’s worth

The automaps are in ldap
auto.master points to auto.home on the same ldap server and has entries like ( set up via yast )

user1 (defaults that you get when you use yast autofs),noatime.rsize=32768,wsize=32768 file1.blah.com:/home/user1
user2 (defaults that you get when you use yast autofs),noatime.rsize=32768,wsize=32768 file1.blah.com:/home/user2
user3 (defaults that you get when you use yast autofs),noatime.rsize=32768,wsize=32768 file2.blah.com:/home/user3
user4 (defaults that you get when you use yast autofs),noatime.rsize=32768,wsize=32768 file2.blah.com:/home/user4

I’m at home and I can’t remember exactly what the defaults say in yast autofs

The r and w size came around after experimenting - if you let it default to the max dolphin can freeze the machine
while it’s copying big files.

Although we have 400 student machines it is unlikely that there are ever more than about 300 in use
at any one time spread over the two servers.

I changed to NFS3 today and the automounts now timeout correctly. I logged on half a dozen users in quick
succession then went for a coffee and when I logged in as root and looked at mount they had all timed out properly ( good !)

We have also changed /etc/sysconfig/autofs so that autofs doesn’t try and browse. We discovered that if you
don’t and a user opens dolphin and goes to /home it shows all of the other directories in /home and kills
the machine. ( you can’t go into the directories BTW )

The main problems are
When you try and log in it freezes for several seconds after you have entered your username and you tab to
the password box so you can’t enter the password
Firefox freezes a lot ( version 13 )
General freezes for a few seconds

Since neither the servers or the network or the workstations seem to be under excessive load
what the heck are the client waiting for !!! All the servers are in our DNS server but the clients
are not. The clients are DHCP but we don’t do dynamic dns - should we - do we need reverse lookups ?

Sorry … that’s it … my brain has melted

Mal

On 09/06/2012 08:16 PM, interele wrote:
> Since neither the servers or the network or the workstations seem to be
> under excessive load what the heck are the client waiting for

understand: i am not a guru…i’m a generalist…i am absolutely not a
networking guy…

so, i do not know your problem’s solution–but i have heard of things
like “network collisions” and mismatched thing-a-ma-jigs and and and

i HOPE a network guru comes in here eventually…anyone reading who
knows what is going on PLEASE jump in (and i’ll jump out)!!

one thing you really need to know: though there are some gurus around
here from time to time, the forums are populated by volunteer
users…yes, some users here have real world experience as paid
systems administrators of large and complex networks…BUT, even though
those may be here next week you need an answer sooner…so, i’m gonna
tell you a secret–the level of experience and technical capability will
generally be noticeably higher on IRC or the mail list…

its a good thing (i think) for you to ask in those venue…really.

HOWEVER, you said (somewhere) that you often got “You are an idiot” here
so be advised: while the better answers are likely to come in the ML/IRC
you also might actually run into some really rude folks…here we
really try hard to not say RTFM, over there they will expect you to have
read . . .

so, be warned…and, i’d suggest you give a short into/preliminary on
things like you have just installed xxx machines with openSUSE xx.x in a
school and though most is going good you still need some help with blah
blah “because i must be missing something obvious” . . .

but, before you do that be sure and read the ‘rules’ of the ML (like, no
top post) here
http://en.opensuse.org/openSUSE:Mailing_list_netiquette

then join the list using the info here:
http://en.opensuse.org/openSUSE:Communication_channels#Mailing_lists

and/or if you wanna real time chat you will find info on that on the
same page…but, you take the chance of who is alive when you hit the
waves…

check back here because The Guru you need might be forming The Answer
this very second…AND, when the answer is found please share it to
this thread!!


dd http://tinyurl.com/DD-Caveat

Many thanks

Mal

PS Check out the general chit chat forum

On Wed, 05 Sep 2012 17:46:01 GMT, interele
<interele@no-mx.forums.opensuse.org> wrote:

>
>We have some issues with some machines being very slow to log on and
>applications freezing for minutes
>( particularly firefox )
>
>I am currently at a bit of a loss as to why. I am going to try going
>back to nfs3 tomorrow and see what happens
>I discovered that the iMacs attached to the same servers perform really
>really badly when I used nfs4 but positively
>flew when I used nfs3 homes directories.
>
>Apart from that I was wondering if the server having to cope with half
>a dozen mounts from each machine
>is causing it to run out of steam. We have only a few more machines up
>and running as we had in the system
>tests the only difference is that during the tests very few people
>logged on consecutively between reboots
>now there are up to ten per machine. I have looked at nsfstat, netstat
>watched the system monitor and the
>server doesn’t seem stressed but it has a hell of a lot of connections.
>I have tried varying numbers of nfsd
>processes and that makes no differece. Setting the mount to r and w
>size to 32768 improved things a bit but
>nothing to write home about
>
>Any ideas ?
>
>Mal

  1. Completely agree with reverting to nfs3, i couldn’t even get nfs4 to
    work.

  2. Be thoughtful about what gets mounted at boot (/etc/fstab) and what
    gets mounted at logon (autofs does not always play nicely at logon.) It
    may be to the point to sudo a direct mount command as part of logon.

Some thing to try that you may not have done yet.

?-)

On Wed, 05 Sep 2012 19:43:51 GMT, Martin Helm
<martin_helm@no-mx.forums.opensuse.org> wrote:

>I hope an autofs expert jumps in here, I have not much experience. From
>what I quickly read now on the arch wiki, autofs is simply not designed
>to unmount on logout but has an optional --timeout parameter for the
>file /etc/auto.master to unmount after a certain amount of inactivity.
>https://wiki.archlinux.org/index.php/Autofs
>I would try to set that to let’s say 600 seconds or so that latest 10
>min after logout the automatic unmount appears, you may want to play
>with that value.
>
>Maybe that helps.

Seriously not a good idea for /home.

?-)

On Thu, 06 Sep 2012 18:16:02 GMT, interele
<interele@no-mx.forums.opensuse.org> wrote:

>
>In answer to the various points/questions posted
>
>I have 2 (very big ( although not Crays :wink: dd@home )) servers
>File1
>/home/
>user1
>user2
>
>File2
>/home/
>user3
>user4
>
>Each server has about 600 home directories ( these are the ex Windows
>2003 servers that serviced the same number of
>users ( I added a better raid controller and 12Gb of ram ) and I just
>export /home on both. /home *(rw,async,no_subtree_check)
>
>Question :- in this scenario should I have no_subtree_check ? I have
>heard some people say sub tree checking is more trouble
>than it’s worth
>
>The automaps are in ldap
>auto.master points to auto.home on the same ldap server and has entries
>like ( set up via yast )
>
>user1 (defaults that you get when you use yast
>autofs),noatime.rsize=32768,wsize=32768 file1.blah.com:/home/user1
>user2 (defaults that you get when you use yast
>autofs),noatime.rsize=32768,wsize=32768 file1.blah.com:/home/user2
>user3 (defaults that you get when you use yast
>autofs),noatime.rsize=32768,wsize=32768 file2.blah.com:/home/user3
>user4 (defaults that you get when you use yast
>autofs),noatime.rsize=32768,wsize=32768 file2.blah.com:/home/user4
>
>I’m at home and I can’t remember exactly what the defaults say in yast
>autofs
>
>The r and w size came around after experimenting - if you let it
>default to the max dolphin can freeze the machine
>while it’s copying big files.
>
>Although we have 400 student machines it is unlikely that there are
>ever more than about 300 in use
>at any one time spread over the two servers.
>
>I changed to NFS3 today and the automounts now timeout correctly. I
>logged on half a dozen users in quick
>succession then went for a coffee and when I logged in as root and
>looked at mount they had all timed out properly ( good !)
>
>We have also changed /etc/sysconfig/autofs so that autofs doesn’t try
>and browse. We discovered that if you
>don’t and a user opens dolphin and goes to /home it shows all of the
>other directories in /home and kills
>the machine. ( you can’t go into the directories BTW )
>
>The main problems are
>When you try and log in it freezes for several seconds after you have
>entered your username and you tab to
>the password box so you can’t enter the password
>Firefox freezes a lot ( version 13 )
>General freezes for a few seconds
>
>Since neither the servers or the network or the workstations seem to be
>under excessive load
>what the heck are the client waiting for !!! All the servers are in
>our DNS server but the clients
>are not. The clients are DHCP but we don’t do dynamic dns - should we -
>do we need reverse lookups ?
>
>Sorry … that’s it … my brain has melted
>
>
>Mal

Each to their own but when i can make it work i use static addressing, and
reserved addressing at the routers when i can’t (but it associates ip
addresses with nic addresses, almost as good).

?-)

On Thu, 06 Sep 2012 17:15:17 GMT, “Carlos E. R.”
<robin_listas@no-mx.forums.opensuse.org> wrote:

>On 2012-09-06 11:31, dd@home.dk wrote:
>
>
>> me too, but (again) how does a partition being mounted affect anything, if that partition is not
>> being hit?
>
>It is a resource that is in use and does not need to. If you have hundreds of users it has an impact
>on the server.
>
>For example, if you need to reboot the server, it is preferable to see 5mounted shares that a
>hundred, of which only 5 are actually used.
>
>> WAIT!! why would each user need to have a unique mountable partition, anyway!?
>
>It is one of the tricks done when home is remotely mounted via nfs. You do not need to mount home
>for a user or several users on boot, you mount it exactly when needed. And a refinement is use
>different homes for each user, auto-exported separately, I don’t remember why.
>
>There was a thread about this in the opensuse mail list (search for Lynn, IIRC)

That may become a scripting issue depending on how often classes are
created and how long they last. If i had to create and delete 600 users a
week i would certainly find a way to script it. Even annually i would
script it.

?-)