summaryrefslogtreecommitdiff
path: root/www-servers/varnish/files/varnishncsa.initd
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/varnish/files/varnishncsa.initd')
-rw-r--r--www-servers/varnish/files/varnishncsa.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/www-servers/varnish/files/varnishncsa.initd b/www-servers/varnish/files/varnishncsa.initd
new file mode 100644
index 00000000000..7b38397670d
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
+command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
+pidfile="${VARNISHNCSA_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}