Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a minor inconvenience involving NIS and autofs. I pull my home directory from an NFS server. It all works fine, except that I have to manually restart nis and autofs after each reboot. So after the system starts up, I need to switch to a console (or ssh into the machine) and do

sudo service nis restart
sudo service autofs restart

After this, everything works like a charm, with no problems.

If I don't do that, I can't get past the login screen. To give an example, I have two users on the system, call them localuser (password and home directory on the machine) and remoteuser (password on the remote machine, home directory on NFS). Now, after a fresh reboot, I can log in as localuser with no problems. If I try to login as remoteuser, my password is accepted but no home directory is found, so if I try to log in using GNOME, I get an instant logout. I can still log in as remoteuser remotely or after switching to a text terminal (ctrl+alt+f1), but no home directory is found. After restarting NIS and autofs as mentioned above, I can log in as remoteuser with no further problems until a reboot.

So my question is: how do I avoid manually restarting these services after each reboot?

I have been using this computer as a standalone machine, and then moved it to a network, so I imagine some network settings were configured before I installed autofs.
I am using Ubuntu 12.04, but I had a similar problem on a different machine running older versions of Ubuntu.

share|improve this question
I've routinely had this problem on Ubuntu, never on RedHat variants -- but only had to restart autofs. Since I don't have many Ubuntu boxen using our NIS/autofs, on some I've added a cronjob to check for an automounted directory, restarting autofs if necessary: 0,15,30,45 * * * * [ -f /home/sub/groupdir ] || service autofs restart – Lars Rohrbach Oct 26 '12 at 7:03

I had this problem in 14.04.

If your distribution uses Upstart for starting processes, go to /etc/init/autofs.conf and change the line that says

start on runlevel [2345]


start on (local-filesystems and net-device-up IFACE!=lo)

This will make Upstart wait with launching autofs until filesystem and networking is available.

Now, I don't use nis, but I assume this is your main problem. It was for many people. Sorry for reviving this old post. Just thought this information needed to be here

share|improve this answer

This sounds as if the start-order of your services is not ok.

At what level-number is NIS started, at what level-number is autofs started and at what level-number is the nfs-client started?

How does your autofs-configuration for your home-directory look like?

Is it in auto.master or is it a submap?

share|improve this answer

In /etc/init/ypbind.conf I added directly after "pre-start script":

    while [ ! -e /var/run/network/ifup.eth? ]
      sleep 0.1

It's because autofs starts before the Networkmanager has brought up the interface. Then NIS looks for the mounts and can't find the NFS Filesystem, because it isn't provided by autofs. Start ypbind after your interface is up and everything is allright.

share|improve this answer

Try running the following commands:

 #sudo update-rc.d nis defaults
 #sudo update-rc.d autofs defaults

to reset the init scripts to default start sequence.

share|improve this answer
Note that at least as of Ubuntu 11, autofs startup is handled by Upstart, and the default startup sequence of nis and autofs still appears to be inadequate. – Lars Rohrbach Oct 26 '12 at 7:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.