r4123 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Jun 21 10:50:30 CEST 2009


Author: phk
Date: 2009-06-21 10:50:30 +0200 (Sun, 21 Jun 2009)
New Revision: 4123

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_child.c
Log:
If we fail to start the child, set it to state stopping to prevent
auto_restart from looping over what is almost guaranteed to be a
problem it cannot solve.



Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2009-06-18 16:13:24 UTC (rev 4122)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2009-06-21 08:50:30 UTC (rev 4123)
@@ -344,7 +344,6 @@
 	e->callback = child_listener;
 	AZ(vev_add(mgt_evb, e));
 	ev_listen = e;
-
 	AZ(ev_poker);
 	if (params->ping_interval > 0) {
 		e = vev_new();
@@ -361,11 +360,10 @@
 	if (mgt_push_vcls_and_start(&u, &p)) {
 		REPORT(LOG_ERR, "Pushing vcls failed: %s", p);
 		free(p);
-		/* Pick up any stuff lingering on stdout/stderr */
-		(void)child_listener(NULL, EV_RD);
-		exit(2);
-	}
-	child_state = CH_RUNNING;
+		child_state = CH_RUNNING;
+		mgt_stop_child();
+	} else
+		child_state = CH_RUNNING;
 }
 
 /*--------------------------------------------------------------------*/



More information about the varnish-commit mailing list