[master] 95bf11c Also remove the pid-file when we stop because CLI on stdin closed.

Poul-Henning Kamp phk at FreeBSD.org
Wed Mar 11 09:41:42 CET 2015


commit 95bf11c9dde1e57cdce2bfda1f1da18dff6e191d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 11 08:31:02 2015 +0000

    Also remove the pid-file when we stop because CLI on stdin closed.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 7864a15..b7fc72f 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -68,6 +68,8 @@ struct vsb		*vident;
 struct VSC_C_mgt	static_VSC_C_mgt;
 struct VSC_C_mgt	*VSC_C_mgt;
 
+static struct vpf_fh *pfh = NULL;
+
 /*--------------------------------------------------------------------*/
 
 static void
@@ -286,6 +288,8 @@ cli_stdin_close(void *priv)
 	if (d_flag) {
 		mgt_stop_child();
 		mgt_cli_close_all();
+		if (pfh != NULL)
+			(void)VPF_Remove(pfh);
 		exit(0);
 	}
 }
@@ -376,7 +380,6 @@ main(int argc, char * const *argv)
 	const char *T_arg = "localhost:0";
 	char *p, *vcl = NULL;
 	struct cli cli[1];
-	struct vpf_fh *pfh = NULL;
 	char *dirname;
 	char **av;
 	unsigned clilim;



More information about the varnish-commit mailing list