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

In the mean time have a look at this patch.

autofs-5.0.7 - fix map read fail incorrectly set on master re-read

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


[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