diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-04-14 08:59:08 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-04-14 09:03:30 +0000 |
commit | e59b4743337fdb0dc950ce9d1f03a9c747472b63 (patch) | |
tree | 1fc1dc47564822632445b43494bc31f9d014c8cd /main/varnish/varnishlog.initd | |
parent | 0126ba3d84d35779e1ff8a0b5eb0d1162b37796a (diff) | |
download | aports-e59b4743337fdb0dc950ce9d1f03a9c747472b63.tar.bz2 aports-e59b4743337fdb0dc950ce9d1f03a9c747472b63.tar.xz |
main/varnish: sync with openrc scripts from gentoo
Diffstat (limited to 'main/varnish/varnishlog.initd')
-rw-r--r-- | main/varnish/varnishlog.initd | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/varnish/varnishlog.initd b/main/varnish/varnishlog.initd new file mode 100644 index 0000000000..fae8297743 --- /dev/null +++ b/main/varnish/varnishlog.initd @@ -0,0 +1,32 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +VARNISHLOG_PID=${VARNISHLOG_PID:-/run/${SVCNAME}.pid} + +command="${VARNISHLOG:-/usr/bin/varnishlog}" +command_args="-D -P ${VARNISHLOG_PID} ${VARNISHLOG_OPTS}" +pidfile="${VARNISHLOG_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 ${VARNISHLOG_PID} -s SIGHUP + eend $? +} + +flush() { + ebegin "Flushing any outstanding transactions" + start-stop-daemon -p ${VARNISHLOG_PID} -s SIGUSR1 + eend $? +} + +reload() { + flush + rotate +} |