LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Lately something triggers NFS to be automounted at gnome login. Can't use laptop when not at home. (https://www.linuxquestions.org/questions/linux-desktop-74/lately-something-triggers-nfs-to-be-automounted-at-gnome-login-can%27t-use-laptop-when-not-at-home-4175600494/)

tvind 02-24-2017 02:00 AM

Lately something triggers NFS to be automounted at gnome login. Can't use laptop when not at home.
 
Hei.

I run fedora 25 on a laptop and have used autofs to access NFS for a long time without a hassle.

Lately something (within gnome) triggers autofs to mount NFS, which shouldn't be the case and never was before.

So when I boot the laptop without network connection to the NFS server I can't log into a gnome session. It just hangs with a grey screen for about 5 minutes then the screen turns white and a message appears: Ops, something went wrong, session can't be recoverd.

'gedit' does something similar, that's why I suspect something inside Gnome. I have of course edited files from the NFS share in 'gedit' but even when I start it empty with no file it triggers autofs to automount NFS.

So how can I trace down what application is triggering autofs when I login to Gnome?
I can't use my laptop anymore when I'm not at home :(

Help appreciated
Thanks!

ferrari 02-24-2017 05:17 AM

Just a guess from me.... could this be tracker at work attempting to index the NFS shares?

https://mail.gnome.org/archives/trac.../msg00013.html
https://ask.fedoraproject.org/en/que...cker-in-gnome/

Apologies if on the wrong track here :)

tvind 02-24-2017 08:00 AM

Good idea, but sadly it's not that.

Any more suggestions?

ferrari 02-24-2017 02:17 PM

Hmmm...it has to be something relying on a cache rather than autofs. I'm not a Gnome user so can really only offer basic advice here), but you could check settings in dconf-editor perhaps...

dconf-editor > org > gnome > desktop > media-handling

I know this is where auto-mounting is configured, but not sure what else can be configured there, and it's not clear to me what else would try to use a stale mount unless it was cached by that system.

ferrari 02-24-2017 02:50 PM

You could try increasing the logging verbosity of autofs in the hope that it might provide more clues about what is causing it to be triggered perhaps...

Quote:

To enable logging (default is no logging at all), uncomment and add --verbose to the OPTIONS line in /etc/default/autofs e.g.:

OPTIONS='--verbose --timeout=5'

After restarting the autofs daemon, verbose output is visible in systemctl status or in journalctl.
https://wiki.archlinux.org/index.php...nal_parameters

Restart it with
Code:

systemctl restart autofs
and check journal output for autofs.service logging...
Code:

journalctl -u autofs
or to watch the logging tail....
Code:

journalctl -fu autofs

tvind 02-24-2017 04:52 PM

Hei ferrari,

Good idea to increase logging, here is some output. I shut down, then removed the ethernet cable and Gnome session won't
start until I reconnected the cable.

It looks like autofs just attempts to mount NFS for whatever reason, nothing else involved.
As you suggestet I also disabled to automount all media in the dconf-editor.

I also waited until autofs unmounted by itself after 15 minutes just to make sure there isn't some mechanism that
tries to restore the old state on reboot.

Sadly, nothing changed, but now it's clear that it is autofs itself.

Code:

Feb 24 23:10:40 dell7240.home.no automount[1611]: 1 remaining in /nfs
Feb 24 23:14:25 dell7240.home.no automount[1611]: 1 remaining in /nfs
Feb 24 23:18:10 dell7240.home.no automount[1611]: 1 remaining in /nfs
Feb 24 23:21:55 dell7240.home.no automount[1611]: expiring path /nfs/zmicro
Feb 24 23:21:55 dell7240.home.no automount[1611]: expired /nfs/zmicro
Feb 24 23:23:18 dell7240.home.no systemd[1]: Stopping Automounts filesystems on demand...
Feb 24 23:23:18 dell7240.home.no automount[1611]: umounted indirect mount /nfs
Feb 24 23:23:18 dell7240.home.no systemd[1]: Stopped Automounts filesystems on demand.
I removed the ethernet cable here...
-- Reboot --
Feb 24 23:24:09 dell7240.home.no systemd[1]: Starting Automounts filesystems on demand...
Feb 24 23:24:09 dell7240.home.no automount[1614]: Starting automounter version 5.1.2-1.fc25, master map auto.master
Feb 24 23:24:09 dell7240.home.no automount[1614]: using kernel protocol version 5.02
Feb 24 23:24:09 dell7240.home.no automount[1614]: mounted indirect on /nfs with timeout 900, freq 225 seconds
Feb 24 23:24:09 dell7240.home.no automount[1614]: ghosting enabled
Feb 24 23:24:09 dell7240.home.no systemd[1]: Started Automounts filesystems on demand.
Feb 24 23:24:14 dell7240.home.no automount[1614]: attempting to mount entry /nfs/zmicro
Feb 24 23:27:14 dell7240.home.no automount[1614]: >> mount.nfs: Connection timed out
Feb 24 23:27:14 dell7240.home.no automount[1614]: mount(nfs): nfs: mount failure 192.168.1.3:/zmicro on /nfs/zmicro
Feb 24 23:27:14 dell7240.home.no automount[1614]: failed to mount /nfs/zmicro
Gnome session won't start until I connected ethernet cable here.
Feb 24 23:27:14 dell7240.home.no automount[1614]: re-reading map for /nfs
Feb 24 23:27:15 dell7240.home.no automount[1614]: attempting to mount entry /nfs/zmicro
Feb 24 23:28:38 dell7240.home.no automount[1614]: mounted /nfs/zmicro
Feb 24 23:28:38 dell7240.home.no automount[1614]: re-reading map for /nfs

I cant't think of any reason why autofs attempts to mount NFS when logging in to gnome.

Thanks for your help ferrari.
Do you see anything strange in the log?

ferrari 02-24-2017 07:25 PM

This may be relevant...

https://mail.gnome.org/archives/gvfs.../msg00001.html

It links to this Gnome bug report. In particular comment#5 nicely summarises
Quote:

I am finally able to reproduce it and see what is wrong with autofs. The difference with autofs in comparison with ordinary mounts is that the mount always exists (you can see it in "/etc/mtab"), but do not have to be really mounted. However, gvfs-udisks2-volume-monitor thinks that it is really mounted if the mount exists...

Consequently, the following code is called which looks for some files on that mounts (e.g. autorun.inf, .xdg-volume-info), which causes the unwanted automounts for autofs...

tvind 02-25-2017 08:18 AM

Hei ferrari, many thanks for all your suggestions.

So I really learned something new about udev, udisks and gvfs. Looked at many suggestet things from the threads and bug report and tried an entry of /etc/fstab containing x-gvfs-hide for my nfs path. Nothing worked.
In the end I returned to search for some sort of Nautilus cache as I had noticed that suddenly NFS got mounted when I just started Nautilus without actually accessing the NFS.
Just for fun I removed the bookmark to the NFS's root directory and made a new one then (that bookmark was there for month without problems).
...and now it works. That's one of those things that make no sense at all but now Nautilus behaves as before and as it should.
Thanks again for pushing me into searching for every possibility!


So, removing the bookmark and recreating it, did the trick.


Cheers!

ferrari 02-25-2017 02:27 PM

I'm glad to have walked along with you on this issue. I knew it had to involve something that was cached, so not surprised by your findings with Nautilus here. Anyway, well done with tracking it down. :)

tvind 02-26-2017 02:04 AM

You were on the right track with some caching problem. Gnome doesn't really make it easy for people to figure out what is going on under the hood.
This morning I noticed that recreating the bookmark to the NFS in Nautilus also fixed the problem that I couldn't start Gedit when not on the network. Nice, I can work again :)
Thanks mate!


All times are GMT -5. The time now is 07:11 PM.