1

In Ubuntu 12.04 I have some users whose home directories are NFS-mounted by automount. All the NFS and automount configurations are right. For a very specific use case, I need to add some lines corresponding to those users 'by hand' to /etc/passwd. Immediately after saving the passwd file, all their home directories are mounted by automount. I don't wan't it to happen. I think It's clear that some process is monitoring the passwd file and accesses the home directories of all of them. If I umount them and add just another line, then all the homes are mounted again.

I have tried lots of things to try to guess what is happening with no luck. I think this is related to Gnome, because we use another Linux machines that run a home made distro based on the Ubuntu kernel and run Gnome and the same thing happens.

¿Any idea?

LuisM
  • 11
  • 1

2 Answers2

0

Could you go into a bit more detail? Why or what are you modifying? There could be an easier way of solving that issue.

First, you should restart automount with logging enabled so you know which process is triggering the mounts. You should be able to follow along in /var/log/daemon.log. Check the automount man page for details.

Second, I don't know if this matters, but automount should unmount that home directory after a certain amount of inactivity.

Also, are you just editing /etc/passwd as root or are you using vipw or somesuch?

etherfish
  • 1,757
  • 10
  • 12
  • Thank yoy, etherfish. As I say in my question, I just modify the /etc/passwd (not using an editor, but by means of editing scripts). – LuisM Jan 23 '14 at 16:09
0

Thank yoy, etherfish. As I say in my question, I just modify the /etc/passwd (not using an editor, but by means of editing scripts).

I have been using automount for years and know it well, but you have given me a clue: "what process is triggering the mount". I thought automount had no access to this information, and my version of automount, even with the -d option, didn't log that. I have installed the most recient version and it does!

The program that monitors /etc/passwd for changes and accesses all the home directories is the greeter of gdm, looking for faces icons (version 2.30.1, file /gdm/gui/simple-greeter/gdm-user-manager.c).

GDM has a Exclude option to name users whose homes you do not want to be monitored, but is just a comma separated list! If you have hundreds of users it is of no use. Another configuration option is IncludeAll. If you set it to false, the file /etc/passwd will not be monitored, just what I need.

There is even another option: the users who have a login shell not included in the file /etc/shells also won't see their home directory mounted.

LuisM
  • 11
  • 1