Small bug in autofs init script?
Hi all,
I wanted to check this with all of you before I count this as a bug and
submit a report. This is on Debian unstable, autofs-3.1.3-2.1. I checked
on bugs.debian.org, and it seems this bug is not reported.
The problem: when specifying a nis map in the file /etc/auto.master, the
init script does not invoke automount correctly. It does detect that the
map is a nis map, but then constructs a broken invocation line (the map
name is added a bogus path).
Example: suppose you don't have (or don't want to load) a nis
auto.master, but you'd like to load a particular nis map. You can do this
by having such nis map listed in your local /etc/auto.master:
# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
/misc /etc/auto.misc
/home auto.home
The init script seems to be ready to handle this case, because it will
recognize that if there's no local file /etc/auto.home, then it must be a
nis map. But then it constructs this line to invoke automount:
/usr/sbin/automount /home yp /etc/auto.home
when it should have been clearly:
/usr/sbin/automount /home yp auto.home
A POSSIBLE FIX: Just strip the map name of its prefix, once we have
figured out that it must be a nis map. Something like this:
$ diff autofs autofs.orig
118,119c118,119
< map=`echo $map | sed -e 's:^/etc/::'`
< echo "$DAEMON $mountoptions $dir yp $map $options $localoptions"
---
> echo "$DAEMON $mountoptions $dir yp $map $options $localoptions"
>
Or equivalently we could use "basename".
Does this sound OK? Could someone who knows the inner workings of the
autofs init script verify if this is OK?
Jose
PS: By the way, I was also bitten by bug #44584: at boot time ypbind
didn't have time to bind to the NIS server, and automounting failed. A
short delay fixed it.
--
Jose L Marin jose@ma.hw.ac.uk
Dept of Mathematics marin@posta.unizar.es
Heriot-Watt University
Edinburgh EH14 4AS, U.K.
Phone: +44 131 451 3893
Fax: +44 131 451 3249
Reply to: