r4661 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Thu Apr 15 09:13:51 CEST 2010


Author: phk
Date: 2010-04-15 09:13:51 +0200 (Thu, 15 Apr 2010)
New Revision: 4661

Modified:
   trunk/varnish-cache/bin/varnishd/common.h
   trunk/varnish-cache/bin/varnishd/shmlog.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
We need to update the master-process pid in the shmlog after we daemon()'ize.

Spotted by:	Mark Moseley



Modified: trunk/varnish-cache/bin/varnishd/common.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/common.h	2010-04-13 21:07:39 UTC (rev 4660)
+++ trunk/varnish-cache/bin/varnishd/common.h	2010-04-15 07:13:51 UTC (rev 4661)
@@ -43,6 +43,7 @@
 
 /* shmlog.c */
 void VSL_MgtInit(const char *fn, unsigned size);
+void VSL_MgtPid(void);
 extern struct varnish_stats *VSL_stats;
 
 /* varnishd.c */

Modified: trunk/varnish-cache/bin/varnishd/shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/shmlog.c	2010-04-13 21:07:39 UTC (rev 4660)
+++ trunk/varnish-cache/bin/varnishd/shmlog.c	2010-04-15 07:13:51 UTC (rev 4661)
@@ -413,3 +413,10 @@
 	*pp = *params;
 	params = pp;
 }
+
+void
+VSL_MgtPid(void)
+{
+
+	loghead->master_pid = getpid();
+}

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2010-04-13 21:07:39 UTC (rev 4660)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2010-04-15 07:13:51 UTC (rev 4661)
@@ -674,6 +674,8 @@
 	if (!d_flag && !F_flag)
 		AZ(varnish_daemon(1, 0));
 
+	VSL_MgtPid();
+
 	if (pfh != NULL && vpf_write(pfh))
 		fprintf(stderr, "NOTE: Could not write PID file\n");
 




More information about the varnish-commit mailing list