Commit 69dbb6a9 authored by Geoff Simmons's avatar Geoff Simmons

get rid of unused config params

parent a1fb3063
...@@ -342,9 +342,9 @@ command-line options, in this hierarchy: ...@@ -342,9 +342,9 @@ command-line options, in this hierarchy:
If the same config parameter is specified in one or more of these If the same config parameter is specified in one or more of these
sources, then the value at the "higher" level is used. For example, if sources, then the value at the "higher" level is used. For example, if
``varnish.name`` is specified in both ``/etc/varnishevent.conf`` and a ``output.file`` is specified in both ``/etc/varnishevent.conf`` and a
``-f`` file, then the value from the ``-f`` file is used, unless a ``-f`` file, then the value from the ``-f`` file is used, unless a
value is specified with the ``-n`` option, in which case that value is value is specified with the ``-w`` option, in which case that value is
used. used.
The syntax of a configuration file is simply:: The syntax of a configuration file is simply::
...@@ -363,10 +363,6 @@ correspond to command-line options, as shown below. ...@@ -363,10 +363,6 @@ correspond to command-line options, as shown below.
====================== ========== ========================================================================================= ======= ====================== ========== ========================================================================================= =======
Parameter CLI Option Description Default Parameter CLI Option Description Default
====================== ========== ========================================================================================= ======= ====================== ========== ========================================================================================= =======
``varnish.name`` ``-n`` Like the ``-n`` option for Varnish, this is the path to the file that is mmap'd to the default for Varnish (the host name)
shared memory segment for the Varnish log. This parameter and ``varnish.bindump`` are
mutually exclusive.
---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``output.file`` ``-w`` File to which logging output is written. ``stdout`` ``output.file`` ``-w`` File to which logging output is written. ``stdout``
---------------------- ---------- ----------------------------------------------------------------------------------------- ------- ---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``append`` ``-a`` (Boolean) Whether to append to ``output.file``. false ``append`` ``-a`` (Boolean) Whether to append to ``output.file``. false
...@@ -375,8 +371,8 @@ Parameter CLI Option Description ...@@ -375,8 +371,8 @@ Parameter CLI Option Description
---------------------- ---------- ----------------------------------------------------------------------------------------- ------- ---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``varnish.bindump`` ``-r`` A binary dump of the Varnish shared memory log obtained from ``varnishlog -B -w``. If a none ``varnish.bindump`` ``-r`` A binary dump of the Varnish shared memory log obtained from ``varnishlog -B -w``. If a none
value is specified, ``varnishevent`` reads from that file instead of a live Varnish log value is specified, ``varnishevent`` reads from that file instead of a live Varnish log
(useful for testing, debugging and replaying traffic). This parameter and (useful for testing, debugging and replaying traffic). This parameter and the ``-n`` or
``varnish.name`` are mutually exclusive. ``-N`` options are mutually exclusive.
---------------------- ---------- ----------------------------------------------------------------------------------------- ------- ---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``cformat`` ``-F`` Output format for client transactions, using the formatter syntax shown for the ``-F`` default for ``-F`` ``cformat`` ``-F`` Output format for client transactions, using the formatter syntax shown for the ``-F`` default for ``-F``
option above. By default, client transactions are logged, using the default format option above. By default, client transactions are logged, using the default format
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <limits.h> #include <limits.h>
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
#include <pwd.h>
#include "config.h" #include "config.h"
...@@ -49,8 +48,6 @@ ...@@ -49,8 +48,6 @@
#include "vas.h" #include "vas.h"
#include "vdef.h" #include "vdef.h"
#define DEFAULT_USER "nobody"
static const int facilitynum[8] = static const int facilitynum[8] =
{ LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5, { LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5,
LOG_LOCAL6, LOG_LOCAL7 }; LOG_LOCAL6, LOG_LOCAL7 };
...@@ -137,19 +134,16 @@ CONF_Add(const char *lval, const char *rval) ...@@ -137,19 +134,16 @@ CONF_Add(const char *lval, const char *rval)
{ {
int ret; int ret;
confString("pid.file", pid_file);
confString("log.file", log_file); confString("log.file", log_file);
confString("output.file", output_file); confString("output.file", output_file);
confString("varnish.bindump", varnish_bindump); confString("varnish.bindump", varnish_bindump);
confVSB("varnish.name", varnish_name);
confVSB("cformat", cformat); confVSB("cformat", cformat);
confVSB("bformat", bformat); confVSB("bformat", bformat);
confVSB("rformat", rformat); confVSB("rformat", rformat);
confVSB("syslog.ident", syslog_ident); confVSB("syslog.ident", syslog_ident);
confUnsigned("max.reclen", max_reclen); confUnsigned("max.reclen", max_reclen);
confUnsigned("max.headers", max_headers);
confUnsigned("max.vcl_log", max_vcl_log); confUnsigned("max.vcl_log", max_vcl_log);
confUnsigned("max.vcl_call", max_vcl_call); confUnsigned("max.vcl_call", max_vcl_call);
confUnsigned("chunk_size", chunk_size); confUnsigned("chunk_size", chunk_size);
...@@ -168,18 +162,6 @@ CONF_Add(const char *lval, const char *rval) ...@@ -168,18 +162,6 @@ CONF_Add(const char *lval, const char *rval)
return(0); return(0);
} }
if (strcmp(lval, "user") == 0) {
struct passwd *pw;
pw = getpwnam(rval);
if (pw == NULL)
return(EINVAL);
bprintf(config.user_name, "%s", pw->pw_name);
config.uid = pw->pw_uid;
config.gid = pw->pw_gid;
return(0);
}
if (strcmp(lval, "output.timeout") == 0) { if (strcmp(lval, "output.timeout") == 0) {
double to; double to;
int err = conf_getDouble(rval, &to); int err = conf_getDouble(rval, &to);
...@@ -228,17 +210,12 @@ conf_ParseLine(char *ptr, char **lval, char **rval) ...@@ -228,17 +210,12 @@ conf_ParseLine(char *ptr, char **lval, char **rval)
void void
CONF_Init(void) CONF_Init(void)
{ {
struct passwd *pw;
bprintf(config.pid_file, "%s", DEFAULT_PID_FILE);
config.log_file[0] = '\0'; config.log_file[0] = '\0';
/* Default is stdout */ /* Default is stdout */
config.output_file[0] = '\0'; config.output_file[0] = '\0';
config.varnish_bindump[0] = '\0'; config.varnish_bindump[0] = '\0';
bprintf(config.syslog_facility_name, "%s", "LOCAL0"); bprintf(config.syslog_facility_name, "%s", "LOCAL0");
config.varnish_name = VSB_new_auto();
VSB_finish(config.varnish_name);
config.cformat = VSB_new_auto(); config.cformat = VSB_new_auto();
VSB_cpy(config.cformat, DEFAULT_CFORMAT); VSB_cpy(config.cformat, DEFAULT_CFORMAT);
VSB_finish(config.cformat); VSB_finish(config.cformat);
...@@ -256,7 +233,6 @@ CONF_Init(void) ...@@ -256,7 +233,6 @@ CONF_Init(void)
config.output_bufsiz = BUFSIZ; config.output_bufsiz = BUFSIZ;
config.max_reclen = DEFAULT_MAX_RECLEN; config.max_reclen = DEFAULT_MAX_RECLEN;
config.max_headers = DEFAULT_MAX_HEADERS;
config.max_vcl_log = DEFAULT_MAX_VCL_LOG; config.max_vcl_log = DEFAULT_MAX_VCL_LOG;
config.max_vcl_call = DEFAULT_MAX_VCL_CALL; config.max_vcl_call = DEFAULT_MAX_VCL_CALL;
config.max_data = DEFAULT_MAX_DATA; config.max_data = DEFAULT_MAX_DATA;
...@@ -266,14 +242,6 @@ CONF_Init(void) ...@@ -266,14 +242,6 @@ CONF_Init(void)
config.append = 0; config.append = 0;
config.output_timeout.tv_sec = 0; config.output_timeout.tv_sec = 0;
config.output_timeout.tv_usec = 0; config.output_timeout.tv_usec = 0;
pw = getpwnam(DEFAULT_USER);
if (pw == NULL)
pw = getpwuid(getuid());
AN(pw);
bprintf(config.user_name, "%s", pw->pw_name);
config.uid = pw->pw_uid;
config.gid = pw->pw_gid;
} }
static int static int
...@@ -364,8 +332,6 @@ CONF_ReadFile(const char *file) { ...@@ -364,8 +332,6 @@ CONF_ReadFile(const char *file) {
void void
CONF_Dump(void) CONF_Dump(void)
{ {
confdump("pid.file = %s", config.pid_file);
confdump("varnish.name = %s", VSB_data(config.varnish_name));
confdump("log.file = %s", confdump("log.file = %s",
strcmp(config.log_file,"-") == 0 ? "stdout" : config.log_file); strcmp(config.log_file,"-") == 0 ? "stdout" : config.log_file);
confdump("varnish.bindump = %s", config.varnish_bindump); confdump("varnish.bindump = %s", config.varnish_bindump);
...@@ -382,12 +348,10 @@ CONF_Dump(void) ...@@ -382,12 +348,10 @@ CONF_Dump(void)
confdump("syslog.ident = %s", VSB_data(config.syslog_ident)); confdump("syslog.ident = %s", VSB_data(config.syslog_ident));
confdump("monitor.interval = %u", config.monitor_interval); confdump("monitor.interval = %u", config.monitor_interval);
confdump("max.reclen = %u", config.max_reclen); confdump("max.reclen = %u", config.max_reclen);
confdump("max.headers = %u", config.max_headers);
confdump("max.vcl_log = %u", config.max_vcl_log); confdump("max.vcl_log = %u", config.max_vcl_log);
confdump("max.vcl_call = %u", config.max_vcl_call); confdump("max.vcl_call = %u", config.max_vcl_call);
confdump("max.data = %u", config.max_data); confdump("max.data = %u", config.max_data);
confdump("chunk.size = %u", config.chunk_size); confdump("chunk.size = %u", config.chunk_size);
confdump("idle.pause = %f", config.idle_pause); confdump("idle.pause = %f", config.idle_pause);
confdump("output.bufsiz = %u", config.output_bufsiz); confdump("output.bufsiz = %u", config.output_bufsiz);
confdump("user = %s", config.user_name);
} }
...@@ -129,11 +129,6 @@ pthread_cond_t spscq_ready_cond; ...@@ -129,11 +129,6 @@ pthread_cond_t spscq_ready_cond;
pthread_mutex_t spscq_ready_lock; pthread_mutex_t spscq_ready_lock;
struct config { struct config {
char pid_file[PATH_MAX + 1];
/* VSL 'n' argument */
struct vsb *varnish_name;
char log_file[PATH_MAX + 1]; char log_file[PATH_MAX + 1];
char output_file[PATH_MAX + 1]; char output_file[PATH_MAX + 1];
...@@ -160,18 +155,12 @@ struct config { ...@@ -160,18 +155,12 @@ struct config {
unsigned chunk_size; unsigned chunk_size;
/* varnishd param http_max_hdr */
unsigned max_headers;
unsigned max_vcl_log; unsigned max_vcl_log;
unsigned max_vcl_call; unsigned max_vcl_call;
unsigned max_data; unsigned max_data;
size_t output_bufsiz; size_t output_bufsiz;
char user_name[LOGIN_NAME_MAX + 1];
uid_t uid;
gid_t gid;
} config; } config;
/* varnishevent.c */ /* varnishevent.c */
......
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