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:
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
``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
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.
The syntax of a configuration file is simply::
......@@ -363,10 +363,6 @@ correspond to command-line options, as shown below.
====================== ========== ========================================================================================= =======
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``
---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``append`` ``-a`` (Boolean) Whether to append to ``output.file``. false
......@@ -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
value is specified, ``varnishevent`` reads from that file instead of a live Varnish log
(useful for testing, debugging and replaying traffic). This parameter and
``varnish.name`` are mutually exclusive.
(useful for testing, debugging and replaying traffic). This parameter and the ``-n`` or
``-N`` options are mutually exclusive.
---------------------- ---------- ----------------------------------------------------------------------------------------- -------
``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
......
......@@ -39,7 +39,6 @@
#include <limits.h>
#include <math.h>
#include <unistd.h>
#include <pwd.h>
#include "config.h"
......@@ -49,8 +48,6 @@
#include "vas.h"
#include "vdef.h"
#define DEFAULT_USER "nobody"
static const int facilitynum[8] =
{ LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5,
LOG_LOCAL6, LOG_LOCAL7 };
......@@ -137,19 +134,16 @@ CONF_Add(const char *lval, const char *rval)
{
int ret;
confString("pid.file", pid_file);
confString("log.file", log_file);
confString("output.file", output_file);
confString("varnish.bindump", varnish_bindump);
confVSB("varnish.name", varnish_name);
confVSB("cformat", cformat);
confVSB("bformat", bformat);
confVSB("rformat", rformat);
confVSB("syslog.ident", syslog_ident);
confUnsigned("max.reclen", max_reclen);
confUnsigned("max.headers", max_headers);
confUnsigned("max.vcl_log", max_vcl_log);
confUnsigned("max.vcl_call", max_vcl_call);
confUnsigned("chunk_size", chunk_size);
......@@ -168,18 +162,6 @@ CONF_Add(const char *lval, const char *rval)
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) {
double to;
int err = conf_getDouble(rval, &to);
......@@ -228,17 +210,12 @@ conf_ParseLine(char *ptr, char **lval, char **rval)
void
CONF_Init(void)
{
struct passwd *pw;
bprintf(config.pid_file, "%s", DEFAULT_PID_FILE);
config.log_file[0] = '\0';
/* Default is stdout */
config.output_file[0] = '\0';
config.varnish_bindump[0] = '\0';
bprintf(config.syslog_facility_name, "%s", "LOCAL0");
config.varnish_name = VSB_new_auto();
VSB_finish(config.varnish_name);
config.cformat = VSB_new_auto();
VSB_cpy(config.cformat, DEFAULT_CFORMAT);
VSB_finish(config.cformat);
......@@ -256,7 +233,6 @@ CONF_Init(void)
config.output_bufsiz = BUFSIZ;
config.max_reclen = DEFAULT_MAX_RECLEN;
config.max_headers = DEFAULT_MAX_HEADERS;
config.max_vcl_log = DEFAULT_MAX_VCL_LOG;
config.max_vcl_call = DEFAULT_MAX_VCL_CALL;
config.max_data = DEFAULT_MAX_DATA;
......@@ -266,14 +242,6 @@ CONF_Init(void)
config.append = 0;
config.output_timeout.tv_sec = 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
......@@ -364,8 +332,6 @@ CONF_ReadFile(const char *file) {
void
CONF_Dump(void)
{
confdump("pid.file = %s", config.pid_file);
confdump("varnish.name = %s", VSB_data(config.varnish_name));
confdump("log.file = %s",
strcmp(config.log_file,"-") == 0 ? "stdout" : config.log_file);
confdump("varnish.bindump = %s", config.varnish_bindump);
......@@ -382,12 +348,10 @@ CONF_Dump(void)
confdump("syslog.ident = %s", VSB_data(config.syslog_ident));
confdump("monitor.interval = %u", config.monitor_interval);
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_call = %u", config.max_vcl_call);
confdump("max.data = %u", config.max_data);
confdump("chunk.size = %u", config.chunk_size);
confdump("idle.pause = %f", config.idle_pause);
confdump("output.bufsiz = %u", config.output_bufsiz);
confdump("user = %s", config.user_name);
}
......@@ -129,11 +129,6 @@ pthread_cond_t spscq_ready_cond;
pthread_mutex_t spscq_ready_lock;
struct config {
char pid_file[PATH_MAX + 1];
/* VSL 'n' argument */
struct vsb *varnish_name;
char log_file[PATH_MAX + 1];
char output_file[PATH_MAX + 1];
......@@ -160,18 +155,12 @@ struct config {
unsigned chunk_size;
/* varnishd param http_max_hdr */
unsigned max_headers;
unsigned max_vcl_log;
unsigned max_vcl_call;
unsigned max_data;
size_t output_bufsiz;
char user_name[LOGIN_NAME_MAX + 1];
uid_t uid;
gid_t gid;
} config;
/* 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