[master] 8c1c32f The -i argument should not control our process name in syslog.
Poul-Henning Kamp
phk at FreeBSD.org
Tue Jun 6 10:55:06 CEST 2017
commit 8c1c32f94ada259afe1e8ade7eb5fad37873af75
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Jun 6 08:54:20 2017 +0000
The -i argument should not control our process name in syslog.
But it should be available via VSM.
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 85113f8..a9ab422 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -290,37 +290,6 @@ init_params(struct cli *cli)
MCF_InitParams(cli);
}
-
-/*--------------------------------------------------------------------*/
-
-static void
-identify(const char *i_arg)
-{
- char id[17], *p;
- int i;
-
- strcpy(id, "varnishd");
-
- if (i_arg != NULL) {
- if (strlen(i_arg) + 1 > 1024)
- ARGV_ERR("Identity (-i) name too long (max 1023).\n");
- heritage.identity = strdup(i_arg);
- AN(heritage.identity);
- i = strlen(id);
- id[i++] = '/';
- for (; i < (sizeof(id) - 1L); i++) {
- if (!isalnum(*i_arg))
- break;
- id[i] = *i_arg++;
- }
- id[i] = '\0';
- }
- p = strdup(id);
- AN(p);
-
- openlog(p, LOG_PID, LOG_LOCAL0);
-}
-
static void
mgt_tests(void)
{
@@ -781,7 +750,11 @@ main(int argc, char * const *argv)
setproctitle("Varnish-Mgr %s", heritage.name);
#endif
- identify(i_arg);
+ if (i_arg == NULL || *i_arg == '\0')
+ i_arg = "varnishd";
+ heritage.identity = i_arg;
+
+ openlog("varnishd", LOG_PID, LOG_LOCAL0);
if (VJ_make_workdir(dirname))
ARGV_ERR("Cannot create working directory (%s): %s\n",
@@ -861,6 +834,8 @@ main(int argc, char * const *argv)
mgt_SHM_Init();
+ mgt_SHM_static_alloc(i_arg, strlen(i_arg) + 1L, "Arg", "-i", "");
+
if (M_arg != NULL)
mgt_cli_master(M_arg);
if (T_arg != NULL)
More information about the varnish-commit
mailing list