Commit ed6f014b authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: first demonized version

parent 668cbd14
...@@ -43,7 +43,20 @@ PKG_PROG_PKG_CONFIG ...@@ -43,7 +43,20 @@ PKG_PROG_PKG_CONFIG
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
#AC_CHECK_HEADERS([sys/stdlib.h])
## From Varnish configure.ac
# white lie - we don't actually test it
AC_MSG_CHECKING([whether daemon() works])
case $target in
*-*-darwin*)
# present but not functional
AC_MSG_RESULT([no])
ac_cv_func_daemon=no
;;
*)
AC_CHECK_FUNCS([daemon])
;;
esac
# Varnish source tree # Varnish source tree
AC_ARG_VAR([VARNISHSRC], [path to Varnish source tree (mandatory)]) AC_ARG_VAR([VARNISHSRC], [path to Varnish source tree (mandatory)])
...@@ -107,6 +120,7 @@ AC_ARG_ENABLE(werror, ...@@ -107,6 +120,7 @@ AC_ARG_ENABLE(werror,
CXXFLAGS="${CXXFLAGS} -Werror" CXXFLAGS="${CXXFLAGS} -Werror"
) )
## From activemq-cpp configure.ac
## Execute Doxygen macros ## Execute Doxygen macros
DX_HTML_FEATURE(ON) DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF) DX_CHM_FEATURE(OFF)
......
...@@ -112,6 +112,7 @@ CONF_Add(const char *lval, const char *rval) ...@@ -112,6 +112,7 @@ CONF_Add(const char *lval, const char *rval)
confUnsigned("maxopen.scale", maxopen_scale); confUnsigned("maxopen.scale", maxopen_scale);
confUnsigned("maxdata.scale", maxdata_scale); confUnsigned("maxdata.scale", maxdata_scale);
confUnsigned("nworkers", nworkers); confUnsigned("nworkers", nworkers);
confUnsigned("restarts", restarts);
if (strcmp(lval, "syslog.facility") == 0) { if (strcmp(lval, "syslog.facility") == 0) {
if ((ret = conf_getFacility(rval)) < 0) if ((ret = conf_getFacility(rval)) < 0)
...@@ -177,6 +178,7 @@ CONF_Init(void) ...@@ -177,6 +178,7 @@ CONF_Init(void)
config.mq_uri[0] = '\0'; config.mq_uri[0] = '\0';
config.mq_qname[0] = '\0'; config.mq_qname[0] = '\0';
config.nworkers = 1; config.nworkers = 1;
config.restarts = 1;
} }
int int
...@@ -248,4 +250,5 @@ CONF_Dump(void) ...@@ -248,4 +250,5 @@ CONF_Dump(void)
confdump("mq.uri = %s", config.mq_uri); confdump("mq.uri = %s", config.mq_uri);
confdump("mq.qname = %s", config.mq_qname); confdump("mq.qname = %s", config.mq_qname);
confdump("nworkers = %d", config.nworkers); confdump("nworkers = %d", config.nworkers);
confdump("restarts = %d", config.restarts);
} }
/*-
* Copyright (c) 2012 UPLEX Nils Goroll Systemoptimierung
* Copyright (c) 2012 Otto Gmbh & Co KG
* All rights reserved
* Use only with permission
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
PARENT(SIGTERM, terminate);
PARENT(SIGINT, terminate);
PARENT(SIGUSR1, SIG_IGN);
PARENT(SIGUSR2, SIG_IGN);
CHILD(SIGTERM, terminate);
CHILD(SIGINT, terminate);
CHILD(SIGUSR1, dump);
CHILD(SIGUSR2, SIG_IGN);
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
echo echo
echo "TEST: $0" echo "TEST: $0"
echo "... testing log output at debug level against a known checksum" echo "... testing log output at debug level against a known checksum"
CKSUM=$(../trackrdrd -f varnish.binlog -l - -d -c test.conf | cksum) CKSUM=$(../trackrdrd -D -f varnish.binlog -l - -d -c test.conf | cksum)
if [ "$CKSUM" != '1094437405 229102' ]; then if [ "$CKSUM" != '772720543 229221' ]; then
echo "ERROR: Regression test incorrect cksum: $CKSUM" echo "ERROR: Regression test incorrect cksum: $CKSUM"
exit 1 exit 1
fi fi
......
This diff is collapsed.
...@@ -147,6 +147,7 @@ struct config { ...@@ -147,6 +147,7 @@ struct config {
char mq_uri[BUFSIZ]; char mq_uri[BUFSIZ];
char mq_qname[BUFSIZ]; char mq_qname[BUFSIZ];
unsigned nworkers; unsigned nworkers;
unsigned restarts;
} config; } config;
void CONF_Init(void); void CONF_Init(void);
......
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