system/5150: ams master map in NIS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

system/5150: ams master map in NIS

Raimo Niskanen
>Number:         5150
>Category:       system
>Synopsis:       It should be possible to use NIS master map for the automounter
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 07 08:00:01 GMT 2006
>Originator:     Raimo Niskanen
>Release:        OpenBSD 3.9, unpatched
        System      : OpenBSD 3.9
        Architecture: OpenBSD.i386
        Machine     : i386
        It is not possible to use a NIS map as master map for
        the 4.4 BSD automounter (amd) without tweaking /etc/rc.
        The master map has to be supplied on the command line to amd,
        and /etc/rc does `cat ${amd_master}` at the end of the
        command line.
        E.g by changing the amd startup in /etc/rc to:

if [ X"${amd}" = X"YES" -a -x ${amd_master} ]; then
        echo -n ' amd'
        (cd /etc/amd; amd -l syslog -x error,noinfo,nostats -p \
            -a ${amd_dir} `${amd_master}` > /var/run/ )

        i.e using a script for master map file, and changing
        /etc/amd/master.sample to:

#! /bin/cat
/home amd.home

        Then anyone that wants to use a NIS master map can create
        /etc/amd/master as:

#! /bin/sh
cat <<-EOF
        `ypcat -k amd.master`

        The `-r' flag is unrelated but it is nice to still be able
        to have extra command line flags in /etc/amd/master.
        There are of course numerous other good solutons, but
        getting the output from `ypcat -k $MASTERMAP` onto
        the amd startup command line is essential.