Re: AutoFS fails to add new entries from auto.master after SIGHUP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2013-03-01 at 18:42 -0300, Leonardo Chiquitto wrote:
> 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.

Right, I think that means that to reproduce the problem a second map
source must be specified and the read must must succeed. I used a second
source that failed when I did this but using one that succeeds does
produce the bad behaviour.

The principle is still the same though. I think it is not correct to
return a failure for the self included file map since we essentially
want to ignore that source.

The problem of entries in the master map mounts list that haven't been
completely setup is a bit more difficult to deal with. On the face of
it, for indirect mounts, simply continuing to the next entry if it isn't
mounted should be enough but I'm not yet clear on the implications for
the direct map.

How about trying this patch:

autofs-5.0.7 - dont fail on master map self include

From: Ian Kent <raven@xxxxxxxxxx>

When reading the master map a self included file map should skip the source
and proceed to the next so, in this case, don't return a map read failure.
---
 CHANGELOG             |    1 +
 modules/lookup_file.c |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 39388a5..97d6f48 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.
+- dont fail on master map self include.
 
 25/07/2012 autofs-5.0.7
 =======================
diff --git a/modules/lookup_file.c b/modules/lookup_file.c
index facb305..411f280 100644
--- a/modules/lookup_file.c
+++ b/modules/lookup_file.c
@@ -397,8 +397,9 @@ int lookup_read_master(struct master *master, time_t age, void *context)
 	unsigned int path_len, ent_len;
 	int entry, cur_state;
 
+	/* Don't return fail on self include, skip source */
 	if (master->recurse)
-		return NSS_STATUS_UNAVAIL;
+		return NSS_STATUS_SUCCESS;
 
 	if (master->depth > MAX_INCLUDE_DEPTH) {
 		error(logopt, MODPREFIX
@@ -443,7 +444,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) {


 

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


[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux