Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

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.