1

I have a few computers with debian lenny on them. One of them has a nis server: 193.167.1.75 I can automount my home directory when I log in:

>ssh 193.167.1.80 -l myuser
>pwd
 /home/nis/myuser

Now, I just installed a debian wheezy on one of them and I can no longer automount home directories (but I still can log in using myuser)

>ssh 193.167.1.80 -l myuser
 Could not chdir to home directory /home/nis/myuser: No such file or directory
>pwd
 /

What I have done until now:

apt-get install nis nfs-common portmap autofs
echo "+::::::" >>/etc/passwd
echo "+::::::::" >>/etc/shadow
echo "+:::" >>/etc/group
echo "mynisserver" > /etc/defaultdomain
echo "ypserver ##.##.##.75" > /etc/yp.conf
nisdomainname mynisserver
/etc/init.d/nis restart
echo "+auto.master" > /etc/auto.master
rm /etc/auto.home
/etc/init.d/autofs restart

Any Idea why home directories are still not mounted?

EDIT 1:

Client side (193.167.1.80)

grep -i automount /var/log/messages
grep -i automount /var/log/syslog

returns nothing (and no new line when logging in)

/etc/init.d/autofs status
[ ok ] automount is running.

nsswitch:

cat /etc/nsswitch.conf 

passwd:         compat nis
group:          compat nis
shadow:         compat nis

hosts:          files dns nis
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

Not sure it has anything to do with it, but just in case:

showmount -a
clnt_create: RPC: Port mapper failure - Unable to receive: errno 111 (Connection refused)

Server side (193.167.1.75):

cat /etc/exports
/home/nis 193.167.1.0/24(sync,rw,no_root_squash,no_subtree_check)

EDIT2:

I tried to manually mount nfs on 193.167.1.80 with root. It worked. Now I need to figure out why autofs don't do it automatically:

mount -t nfs -o rw 193.167.1.75:/home/nis /home/nis
4
  • Anything useful in the logs? Commented Jun 12, 2013 at 13:37
  • Nothing in /var/log/messages. Where can I look otherwise? Commented Jun 12, 2013 at 13:50
  • /var/log/syslog? Commented Jun 12, 2013 at 13:57
  • Nothing in /var/log/syslog either. No new line when logging in and nothing from grep -i automount /var/log/syslog Commented Jun 12, 2013 at 14:02

2 Answers 2

1

I suspect that you have not NFS exported any of the filesystems. Just putting items in an automap does NOT automatically export anything. Check your /etc/exports file on the source server.

Also you need to indicate what the contexts of your two automount maps are.

Also, you should indicate the contents of /etc/nsswitch. If you have this file set wrong, your NIS is never going to be consulted.

7
  • I edited my question. For /etc/nsswitch.conf, I added the first 4 nis keywords. But it works without it on all other computers. Commented Jun 12, 2013 at 16:51
  • 1
    Try adding automount: files nis to your /etc/nsswitch.conf file. Commented Jun 12, 2013 at 16:54
  • 1
    BTW: compat is fine for passwd, group, and shadow lines in your /etc/nsswitch.conf. As this already implies nis. Commented Jun 12, 2013 at 16:56
  • Well, I think I broke something (nothing to do with the last file editing): I can't restart /etc/init.d/nis now. Commented Jun 12, 2013 at 17:09
  • 1
    have you tried exportfs -a again on the server side? Just to make sure things got exported. Commented Jun 12, 2013 at 17:47
1

I see this on my system as well. In my situation, when I log in, I see that NIS has started (ypwhich returns the server's name), but the auto-mounter didn't read any of the maps. Restarting autofs (/etc/init.d/autofs restart) takes care of the problem until my next reboot.

I haven't figured out why this is happening on my PC.

I've seen it on some RedHat systems running on a subnet where broadcast access to the NIS server is unavailable. They are configured with a yp.conf that looks like "domain MYDOMAIN server MYNISSERVER". I found that at the point in the boot sequence where ypbind is launched, the DNS resolution for MYNISSERVER fails and YP doesn't bind. Changing MYNISSERVER from a DNS name to a numeric IP address or adding a line to /etc/hosts for MYNISSERVER works there.

On my Debian box, however, this isn't the issue. Ypbind does start successfully. According to the boot-time messages, it fails, but continues in the background. I suspect it succeeds some time after autofs is started, hence the problem.

When I edited /etc/init.d/nis so the delay between retries is 5 seconds, the problem didn't change, so it's not simply a matter of not waiting long enough.

I think, looking at log files, that the startup code is attempting to start NIS before the NetworkManager/DHCP has finished trying to bring up the interface, meaning there is no interface for it to try and connect over.

I was able to work around the problem by adding the following two lines to my /etc/rc.local:

/etc/init.d/nis start
/etc/init.d/autofs restart

SO clearly, something loading between the initial attempt to bring up NIS and the end of the startup sequence (at rc.local) should have been running earlier. According to the content of /etc/rc5.d, this could only be nfs-kernel-server (which I'm not using), cron, and minissdpd, but none of them make sense to me.

So... I don't know exactly what's causing your problem, but I may have been able to present you with a workaround. Hopefully someone with more experience than I can add to this and figure out the real cause of the problem that I (and you, probably) are observing.

1
  • +1. I no longer have access on these computers, but it's an interesting diagnosis that I will keep in mind for next time. Commented Dec 18, 2013 at 14:33

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.