r4291 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Thu Oct 8 13:39:00 CEST 2009


Author: tfheen
Date: 2009-10-08 13:39:00 +0200 (Thu, 08 Oct 2009)
New Revision: 4291

Modified:
   branches/2.0/varnish-cache/bin/varnishd/mgt_child.c
Log:
Merge r4123: If child fails to start, stop it.

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: branches/2.0/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/mgt_child.c	2009-10-08 11:28:22 UTC (rev 4290)
+++ branches/2.0/varnish-cache/bin/varnishd/mgt_child.c	2009-10-08 11:39:00 UTC (rev 4291)
@@ -345,7 +345,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();
@@ -362,11 +361,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