From 16d2ad8323bdcaa540d6f7eeb1c35d4cd645d5e6 Mon Sep 17 00:00:00 2001 From: ssm Date: Wed, 20 Feb 2008 12:02:07 +0000 Subject: [PATCH] Debian packaging: Disable running of varnishlog by default git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2520 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/debian/varnish.default | 4 ++++ varnish-cache/debian/varnish.varnishlog.init | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/varnish-cache/debian/varnish.default b/varnish-cache/debian/varnish.default index 441fdc18..1c08d8ca 100644 --- a/varnish-cache/debian/varnish.default +++ b/varnish-cache/debian/varnish.default @@ -11,6 +11,10 @@ NFILES=131072 # the -n switch, to have more instances on a single server. INSTANCE=$(uname -n) +# Uncomment this to enable varnishlog. Please sure you have enough disk space +# for significant amounts of log data. +# VARNISHLOG_ENABLE=1 + # This file contains 4 alternatives, please use only one. ## Alternative 1, Minimal configuration, no VCL diff --git a/varnish-cache/debian/varnish.varnishlog.init b/varnish-cache/debian/varnish.varnishlog.init index 5fd6f256..ba02a630 100755 --- a/varnish-cache/debian/varnish.varnishlog.init +++ b/varnish-cache/debian/varnish.varnishlog.init @@ -22,6 +22,16 @@ DAEMON=/usr/bin/$NAME PIDFILE=/var/run/$NAME.pid LOGFILE=/var/log/varnish/varnish.log +# Include varnish defaults if available +if [ -f /etc/default/varnish ] ; then + . /etc/default/varnish +fi + +# If unset or not 1, exit +if [ -z "${VARNISHLOG_ENABLED}" -o "${VARNISHLOG_ENABLED}" -ne "1" ]; then + exit 0; +fi + test -x $DAEMON || exit 0 DAEMON_OPTS="-a -w ${LOGFILE} -D -P $PIDFILE" -- 2.39.5