On Fri, Mar 1, 2013 at 5:44 AM, Ian Kent <raven@xxxxxxxxxx> wrote: > On Wed, 2013-02-27 at 22:49 -0300, Leonardo Chiquitto wrote: >> Hello, >> >> I've got a bug report describing a case where AutoFS fails to read new >> entries from /etc/auto.master after a SIGHUP. Although the problem >> was reported in an older version of automount, it is reproducible using >> the latest revision from git. >> >> How to reproduce: >> >> 1. Add at least two sources of AutoFS maps to /etc/nsswitch.conf. I've >> tested only with "files nis". You don't need to configure NIS/YP, just >> having it listed there in the configuration is enough. >> >> 2. Start the automounter with a simple /etc/auto.master: >> >> /nfs1 /etc/auto.test1 >> +auto.master >> >> 3. Add another entry to /etc/auto.master: >> >> /nfs1 /etc/auto.test1 >> /nfs2 /etc/auto.test2 >> +auto.master >> >> and reload the daemon. Notice that although AutoFS reads /etc/auto.test2, >> /nfs2 is not created/mounted. >> >> 4. Try to stop the daemon cleanly (SIGTERM only). You'll notice that it won't >> quit. SIGKILL is necessary. > > While the failure to exit when this occurs is a worry probably due to > the presence of a master map entry in the list that was not acted upon. > We probably should come up with way to produce this problem after the > re-read problem is fixed so we can check what is actually happening. Understood. I'll try to write a patch to make it ignore these "partial" entries when exiting. > In the mean time have a look at this patch. > > autofs-5.0.7 - fix map read fail incorrectly set on master re-read I tried it here and unfortunately I'm still able to reproduce the problem. I haven't had time to debug it further yet, but my *impression* is that when reading the entry "+auto.master" from /etc/auto.master it fails with nss source "files" due to the recursion and sets read_fail to 1. Next it tries with nss source "nis" and succeeds, lookup_nss_read_master() returns SUCCESS and the "read_fail = 0" added to lookup_read_master() is never executed. Have a nice weekend! Leonardo > From: Ian Kent <raven@xxxxxxxxxx> > > When re-reading the master map read failures for plus included maps > should not cause the map read to fail, they should be ingored. > --- > CHANGELOG | 1 + > modules/lookup_file.c | 7 ++++++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/CHANGELOG b/CHANGELOG > index 39388a5..b13a5f5 100644 > --- a/CHANGELOG > +++ b/CHANGELOG > @@ -28,6 +28,7 @@ > - make yellow pages support optional. > - modules/replicated.c: use sin6_addr.s6_addr32. > - workaround missing GNU versionsort extension. > +- fix map read fail incorrectly set on master re-read. > > 25/07/2012 autofs-5.0.7 > ======================= > diff --git a/modules/lookup_file.c b/modules/lookup_file.c > index facb305..bca92fd 100644 > --- a/modules/lookup_file.c > +++ b/modules/lookup_file.c > @@ -443,7 +443,7 @@ int lookup_read_master(struct master *master, time_t age, void *context) > > inc = check_master_self_include(master, ctxt); > if (inc) > - master->recurse = 1;; > + master->recurse = 1; > master->depth++; > status = lookup_nss_read_master(master, age); > if (!status) { > @@ -451,6 +451,11 @@ int lookup_read_master(struct master *master, time_t age, void *context) > MODPREFIX > "failed to read included master map %s", > master->name); > + /* > + * Plus map include failures don't cause the map > + * read to fail. > + */ > + master->read_fail = 0; > } > master->depth--; > master->recurse = 0; -- To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html