Commit dd3248ff authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r4661: We need to update the master-process pid in the shmlog after we daemon()'ize.

Spotted by:     Mark Moseley



git-svn-id: http://www.varnish-cache.org/svn/branches/2.1@4687 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0c0f9f08
...@@ -43,6 +43,7 @@ void VSL_Panic(int *len, char **ptr); ...@@ -43,6 +43,7 @@ void VSL_Panic(int *len, char **ptr);
/* shmlog.c */ /* shmlog.c */
void VSL_MgtInit(const char *fn, unsigned size); void VSL_MgtInit(const char *fn, unsigned size);
void VSL_MgtPid(void);
extern struct varnish_stats *VSL_stats; extern struct varnish_stats *VSL_stats;
/* varnishd.c */ /* varnishd.c */
......
...@@ -413,3 +413,10 @@ VSL_MgtInit(const char *fn, unsigned size) ...@@ -413,3 +413,10 @@ VSL_MgtInit(const char *fn, unsigned size)
*pp = *params; *pp = *params;
params = pp; params = pp;
} }
void
VSL_MgtPid(void)
{
loghead->master_pid = getpid();
}
...@@ -674,6 +674,8 @@ main(int argc, char * const *argv) ...@@ -674,6 +674,8 @@ main(int argc, char * const *argv)
if (!d_flag && !F_flag) if (!d_flag && !F_flag)
AZ(varnish_daemon(1, 0)); AZ(varnish_daemon(1, 0));
VSL_MgtPid();
if (pfh != NULL && vpf_write(pfh)) if (pfh != NULL && vpf_write(pfh))
fprintf(stderr, "NOTE: Could not write PID file\n"); fprintf(stderr, "NOTE: Could not write PID file\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment