Making nis automounting work in Debian and Ubuntu (and BSD)

We have a problem that with recent versions of Ubuntu (16.04 and later) and Debian (8 and later) the normal way we set up automounting to mount our nis users home directories doesn’t work – apparently due to boot ordering issues. (It works fine with Red Hat derivatives). We accidentally found a solution when copying a BSD configuration…

We create a file in /etc/auto.master.d (gets read in by auto.master in the standard Debian/Ubuntu setup):

/home auto.astro
/data auto.data
/scratch auto.scratch

Then in /etc we have:

#! /bin/sh -

if test $# -eq 0; then
    ypcat -k auto.home | awk '{print $1}'
else
    ypmatch "$1" auto.home
fi

and

#! /bin/sh -

if test $# -eq 0; then
    ypcat -k auto.scratch | awk '{print $1}'
else
    ypmatch "$1" auto.scratch
fi

etc.

Note these files are shell scripts so need to be executable!

(yes, it’s a bit odd we call the home mapper auto.astro. Historical reasons).

These seem to work reliably on Ubuntu and Debian. This setup actually came from a BSD box.

Published by

Jamie Scott

IT Administrator at the Institute for Gravitational Research, University of Glasgow