[PATCH 04/34] autofs-5.1.2 - don't return until after master map retry read

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

 



The master map read retry needs to be done before returning success
at startup or there can be problems trying to access automount mounts
before they are mounted.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG          |    1 +
 daemon/automount.c |   31 ++++++++++---------------------
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 92a6ea9..7337ec6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -30,6 +30,7 @@ xx/xx/2016 autofs-5.1.3
 - fix included master map not found return.
 - dont exit on master map read fail timeout.
 - set sane default master read wait timeout.
+- don't return until after master map retry read.
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/daemon/automount.c b/daemon/automount.c
index 95b8969..15dadb5 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -2506,27 +2506,6 @@ int main(int argc, char *argv[])
 
 	master_read = master_read_master(master_list, age, 0);
 	if (!master_read) {
-		if (foreground)
-			logerr("%s: failed to read master map, "
-			       "will retry!",
-			       program);
-		else
-			logerr("%s: failed to read master map, "
-			       "will retry in background!",
-			       program);
-	}
-
-	/*
-	 * Mmm ... reset force unlink umount so we don't also do this
-	 * in future when we receive a HUP signal.
-	 */
-	do_force_unlink = 0;
-
-	st_stat = 0;
-	res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
-	close(start_pipefd[1]);
-
-	if (!master_read) {
 		/*
 		 * Read master map, waiting until it is available, unless
 		 * a signal is received, in which case exit returning an
@@ -2544,6 +2523,16 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	/*
+	 * Mmm ... reset force unlink umount so we don't also do this
+	 * in future when we receive a HUP signal.
+	 */
+	do_force_unlink = 0;
+
+	st_stat = 0;
+	res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
+	close(start_pipefd[1]);
+
 	state_mach_thid = pthread_self();
 	statemachine(NULL);
 

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[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