Commit 34693ff8 authored by Lasse Karstensen's avatar Lasse Karstensen

Import files from varnish-cache-debian.git.

(Also briefly called pkg-debian.git.)

As they were in 4.1 head on ee8045e27a0fe8de78189c061a9d30edc7f73395 .
parent 1cafe24b
This diff is collapsed.
Source: varnish
Section: varnish-4.1/web
Priority: optional
Maintainer: Varnish Package Maintainers <varnish-dist@varnish-cache.org>
Build-Depends:
automake,
autotools-dev,
debhelper (>= 9),
libedit-dev,
libjemalloc-dev,
libncurses-dev,
libpcre3-dev,
libtool,
pkg-config,
python-docutils,
python-sphinx
Vcs-Git: git://git.varnish-cache.org/varnish-cache-debian.git
Homepage: https://varnish-cache.org/
Standards-Version: 3.9.6
Package: varnish
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
adduser,
gcc,
libc6-dev | libc6.1-dev | libc-dev,
libvarnishapi1 (>= ${binary:Version})
Suggests: varnish-doc
Provides: varnish, ${Varnish:ABI}, ${Varnish:strictABI}
Description: state of the art, high-performance web accelerator
Varnish Cache is a state of the art web accelerator written with
performance and flexibility in mind.
.
Varnish Cache stores web pages in memory so web servers don't have to
create the same web page over and over again. Varnish serves pages
much faster than any application server; giving the website a
significant speed up.
.
Some of the features include:
* A modern design
* VCL - a very flexible configuration language
* Load balancing with health checking of backends
* Partial support for ESI - Edge Side Includes
* URL rewriting
* Graceful handling of "dead" backends
Package: varnish-doc
Architecture: all
Section: varnish-4.1/doc
Depends: ${misc:Depends}, libjs-jquery, libjs-underscore
Description: documentation for Varnish Cache
This package contains HTML documentation for Varnish Cache.
Package: libvarnishapi1
Section: varnish-4.1/libs
Architecture: any
Provides: libvarnish1
Conflicts: libvarnish1
Pre-Depends: multiarch-support
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: shared libraries for Varnish
Shared libraries for Varnish Cache HTTP accelerator.
Package: libvarnishapi-dev
Section: varnish-4.1/libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libvarnishapi1 (= ${binary:Version}), python
Provides: libvarnish-dev
Conflicts: libvarnish-dev
Description: development files for Varnish
Development files for Varnish Cache HTTP accelerator.
Package: varnish-dbg
Section: varnish-4.1/debug
Priority: extra
Architecture: any
Depends: varnish (= ${binary:Version}),
${misc:Depends}
Description: debugging symbols for varnish
This package contains the detached debugging symbols for Varnish Cache.
.
Varnish Cache is a state of the art web accelerator written with
performance and flexibility in mind.
This package was debianized by Lars Bahner <bahner@debian.org> on
Fri, 6 Oct 2006 16:26:57 +0200.
It was pulled from the Subversion repository at
http://varnish-cache.org/svn/trunk
Debianizations are an integral part of the main source for varnish,
so the change for Debian are made before publication of releases,
and are as such checked.
Files are downloadable from the following URL
http://sourceforge.net/project/showfiles.php?group_id=155816
Copyright: 2006 Verdens Gang AS
2006 Linpro AS
All rights reserved.
License:
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.
The Debian packaging is copyright
© 2006, Lars Bahner <bahner@debian.org>
© 2006-2009 Stig Sandbeck Mathisen <ssm@debian.org>
and is licensed under the GPL version 2. The full text of which can be found in
the file /usr/share/common-licenses/GPL-2 on this system.
usr/include/varnish
usr/share/aclocal
usr/share/varnish/vmodtool.py
/usr/lib/libvarnishapi.so
/usr/lib/pkgconfig/*.pc
libvarnishapi.so.1 libvarnishapi1 #MINVER#
LIBVARNISHAPI_1.0@LIBVARNISHAPI_1.0 3.0.0
VCLI_AuthResponse@LIBVARNISHAPI_1.0 3.0.0
VCLI_ReadResult@LIBVARNISHAPI_1.0 3.0.0
VCLI_WriteResult@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VRE_compile@Base 2.1.4
#MISSING: 3.0.0# VRE_exec@Base 2.1.4
#MISSING: 3.0.0# VRE_free@Base 2.1.4
VSC_Arg@LIBVARNISHAPI_1.0 3.0.0
VSC_Iter@LIBVARNISHAPI_1.0 3.0.0
VSC_Main@LIBVARNISHAPI_1.0 3.0.0
VSC_Open@LIBVARNISHAPI_1.0 3.0.0
VSC_Setup@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_Arg@Base 2.0~rc1
VSL_Arg@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_Close@Base 2.1.0
#MISSING: 3.0.0# VSL_Dispatch@Base 2.0~rc1
VSL_Dispatch@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_H_Print@Base 2.0~rc1
VSL_H_Print@LIBVARNISHAPI_1.0 3.0.0
VSL_Matched@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_Name@Base 2.0~rc1
#MISSING: 3.0.0# VSL_New@Base 2.0~rc1
#MISSING: 3.0.0# VSL_NextLog@Base 2.0~rc1
VSL_NextLog@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_NonBlocking@Base 2.0~rc1
VSL_NonBlocking@LIBVARNISHAPI_1.0 3.0.0
VSL_Open@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_OpenLog@Base 2.0~rc1
#MISSING: 3.0.0# VSL_OpenStats@Base 2.0~rc1
#MISSING: 3.0.0# VSL_Select@Base 2.0~rc1
VSL_Select@LIBVARNISHAPI_1.0 3.0.0
VSL_Setup@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# VSL_tags@Base 2.0~rc1
VSL_tags@LIBVARNISHAPI_1.0 3.0.0
VSM_Close@LIBVARNISHAPI_1.0 3.0.0
VSM_Delete@LIBVARNISHAPI_1.0 3.0.0
VSM_Diag@LIBVARNISHAPI_1.0 3.0.0
VSM_Find_Chunk@LIBVARNISHAPI_1.0 3.0.0
VSM_Head@LIBVARNISHAPI_1.0 3.0.0
VSM_Name@LIBVARNISHAPI_1.0 3.0.0
VSM_New@LIBVARNISHAPI_1.0 3.0.0
VSM_Open@LIBVARNISHAPI_1.0 3.0.0
VSM_ReOpen@LIBVARNISHAPI_1.0 3.0.0
VSM_Seq@LIBVARNISHAPI_1.0 3.0.0
VSM_iter0@LIBVARNISHAPI_1.0 3.0.0
VSM_n_Arg@LIBVARNISHAPI_1.0 3.0.0
#MISSING: 3.0.0# base64_decode@Base 2.0~rc1
#MISSING: 3.0.0# base64_init@Base 2.0~rc1
#MISSING: 3.0.0# lbv_assert@Base 2.1.4
#MISSING: 3.0.0# varnish_instance@Base 2.0~rc1
#!/bin/sh
# reload-varnish: Script to reload varnishd from VCL defined in
# /etc/default/varnish.
#
# Stig Sandbeck Mathisen <ssm@debian.org>
# Settings
defaults=/etc/default/varnish
secret=/etc/varnish/secret
# Paths
varnishadm=/usr/bin/varnishadm
date=/bin/date
tempfile=/bin/tempfile
# Messages
# msg_no_varnishadm: varnishadm
msg_no_varnishadm="Error: Cannot execute %s\n"
msg_no_management="Management port disabled. \$DAEMON_OPTS must contain '-T hostname:port'\n"
# msg_defaults_not_readable: defaults
msg_defaults_not_readable="Error: %s is not readable\n"
# msg_defaults_not_there: defaults
msg_defaults_not_there="Error: %s does not exist\n"
msg_no_vcl="Error: No VCL file used, nothing to reload\n"
msg_usage="Usage: $0 [-h][-c][-q]\n\t-h\tdisplay help\n\t-q\tquiet\n\t-c\tcompile only, do not reload\n"
# msg_compile_only: varnishadm, mgmt_interface, vcl_label
msg_compile_only="To activate, run:\n\t%s -T %s \\\\\n\tvcl.use %s\n"
# msg_compile_failed: vcl_label, vcl_file
msg_compile_failed="Error: vcl.load %s %s failed"
# msg_use_ok: vcl_label
msg_use_ok="VCL reloaded, active label is %s\n"
# msg_use_failed: vcl_label
msg_use_failed="Error: vcl.use %s failed\n"
# msg_secret_not_readable: secret
msg_secret_not_readable="Error: Secret file %s is not readable\n"
# msg_secret_not_there: secret
msg_secret_not_there="Error: Secret file %s does not exist\n"
# Generate a label, prefixed with the caller's username, from the
# kernel random uuid generator, fallback to timestamp
if [ -f /proc/sys/kernel/random/uuid ]
then
uuid=$(cat /proc/sys/kernel/random/uuid)
vcl_label="${LOGNAME}${LOGNAME:+:}${uuid}"
else
vcl_label="$($date +${LOGNAME}${LOGNAME:+:}%s.%N)"
fi
# Load defaults file
if [ -f "$defaults" ]
then
if [ -r "$defaults" ]
then
. "$defaults"
else
printf >&2 "$msg_defaults_not_readable" $defaults
exit 1
fi
else
printf >&2 "$msg_defaults_not_there" $defaults
exit 1
fi
# parse command line arguments
while getopts hcq flag
do
case $flag in
h)
printf >&2 "$msg_usage"
exit 0
;;
c)
compile_only=1
;;
q)
quiet=1
;;
*)
printf >&2 "$msg_usage\n"
exit 1
;;
esac
done
# Parse $DAEMON_OPTS (options must be kept in sync with varnishd).
# Extract the -f and the -T option, and (try to) ensure that the
# management interface is on the form hostname:address.
OPTIND=1
while getopts a:b:CdFf:g:h:i:l:M:n:P:p:S:s:T:t:u:Vw: flag $DAEMON_OPTS
do
case $flag in
f)
if [ -f "$OPTARG" ]; then
vcl_file="$OPTARG"
fi
;;
T)
if [ -n "$OPTARG" -a "$OPTARG" != "${OPTARG%%:*}" ]
then
mgmt_interface="$OPTARG"
fi
;;
S)
secret="$OPTARG"
;;
esac
done
# Sanity checks
if [ ! -x "$varnishadm" ]
then
printf >&2 "$msg_no_varnishadm" $varnishadm
exit 1
fi
if [ -z "$mgmt_interface" ]
then
printf >&2 "$msg_no_management"
exit 1
fi
if [ -z "$vcl_file" ]
then
printf >&2 "$msg_no_vcl"
exit 1
fi
# Check secret file
if [ -f "$secret" ]
then
if [ ! -r "$secret" ]
then
printf >&2 "$msg_secret_not_readable" $secret
exit 1
fi
else
printf >&2 "$msg_secret_not_there" $secret
exit 1
fi
logfile=$($tempfile -n /tmp/$vcl_label)
# Compile and maybe reload
if $varnishadm -T $mgmt_interface -S ${secret} vcl.load $vcl_label $vcl_file
then
if [ -n "$compile_only" ]
then
printf "$msg_compile_only" $varnishadm $mgmt_interface $vcl_label
else
if $varnishadm -T $mgmt_interface -S ${secret} vcl.use $vcl_label
then
printf "$msg_use_ok" $vcl_label
else
printf "$msg_use_failed" $vcl_label
exitstatus=1
fi
fi
else
printf "$msg_compile_failed" $vcl_label $vcl_file
exitstatus=1
fi > $logfile
# Blather
if [ -z "${quiet}" -o -n "$exitstatus" ]
then
grep -v '^$' >&2 $logfile
fi
# Cleanup
rm -f $logfile
exit $exitstatus
#!/usr/bin/make -f
DH_VERBOSE=1
# List of architectures where jemalloc is not available
DISABLE_JEMALLOC_ARCH_LIST := hppa m68k
# Explicitly initialize a variable to select architecture, unless it has been
# defined before. This is compared against the DISABLE_*_LIST variables later
# in this makefile
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# Set local state dir for FHS
LOCAL_CONFIGURE_FLAGS = --localstatedir=/var/lib --libdir=/usr/lib
ifneq ($(filter $(DEB_HOST_ARCH),$(DISABLE_JEMALLOC_ARCH_LIST)),)
LOCAL_CONFIGURE_FLAGS += --disable-jemalloc
endif
VMOD_strictABI = $(shell printf '\#include "vcs_version.h"\nVCS_Version\n' \
| cpp - -Iinclude | sed -e '/^"/!d' -e 's/\"//g' -e 's/^/varnishabi-strict-/')
VMOD_ABI = $(shell printf '\#include "vrt.h"\nvarnishabi- VRT_MAJOR_VERSION . VRT_MINOR_VERSION\n' \
| cpp - -Iinclude \
| sed -e '/^varnishabi-/!d' -e 's/U//g' -e 's/ //g')
# Main build rule, leave everything to debhelper
%:
dh $@ --parallel
ifeq (,$(filter test,$(LOCAL_BUILD_OPTIONS)))
# Disable automated build tests
override_dh_auto_test:
endif
# Override to add local configure flags
override_dh_auto_configure:
dh_auto_configure -- $(LOCAL_CONFIGURE_FLAGS)
override_dh_auto_install:
dh_auto_install -a
install -d debian/tmp/etc/varnish
install -T -m 0644 etc/example.vcl debian/tmp/etc/varnish/default.vcl
@ # Remove .la files
@ # (See http://wiki.debian.org/ReleaseGoals/LAFileRemoval)
find $(CURDIR)/debian/ -name \*.la -delete
@ # Nuke the static libs too
find $(CURDIR)/debian -name \*.a -delete
override_dh_install:
dh_install -a --fail-missing
@ # Override to add the "reload-vcl" script
install -o root -g root -m 755 \
$(CURDIR)/debian/reload-vcl \
$(CURDIR)/debian/varnish/usr/share/varnish/reload-vcl
override_dh_installdocs:
dh_installdocs
@ # Use the packaged javascript libraries
if [ -d $(CURDIR)/debian/varnish-doc ]; then \
rm -f $(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/jquery.js; \
ln -s /usr/share/javascript/jquery/jquery.js \
$(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/jquery.js; \
rm -f $(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/underscore.js; \
ln -s /usr/share/javascript/underscore/underscore.js \
$(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/underscore.js; \
fi
override_dh_gencontrol:
echo "Varnish:strictABI=$(VMOD_strictABI)" >> debian/substvars
echo "Varnish:ABI=$(VMOD_ABI)" >> debian/substvars
if [ -n "$$DEBIAN_OVERRIDE_BINARY_VERSION" ]; then \
dh_gencontrol -- -Tdebian/substvars -v$$DEBIAN_OVERRIDE_BINARY_VERSION; \
else \
dh_gencontrol -- -Tdebian/substvars; \
fi
# Override to add several init scripts
override_dh_installinit:
dh_installinit -a
dh_installinit --name=varnishlog
dh_installinit --name=varnishncsa
override_dh_compress:
dh_compress -X/usr/share/doc/varnish-doc/html
override_dh_strip:
dh_strip --dbg-package=varnish-dbg
Document: varnish-doc
Title: Varnish Cache documentation
Author: Anders Berg, Bjørn Ruberg, Kristian Lyngstøl, Martin Blix
Grydeland, Per Andreas Buer, Poul-Henning Kamp, Tollef Fog Heen
Abstract: The Varnish Cache documentation contains extensive
information about the Varnish Cache software and project. It
contains, among other things, a tutorial, information about
installation, usage and troubleshooting, a section on the Varnish
Command Language, and a large section of rants from the lead
programmer and architect.
Section: Web Development
Format: HTML
Index: /usr/share/doc/varnish-doc/html/index.html
Files: /usr/share/doc/varnish-doc/html/*.html
/usr/share/doc/varnish-doc/html/*/*.html
Document: varnish-changes
Title: Varnish Cache changes
Author: Tollef Fog Heen
Abstract: This document lists significant changes in the Varnish
Cache.
Section: Web Development
Format: HTML
Index: /usr/share/doc/varnish-doc/changes.html
Files: /usr/share/doc/varnish-doc/changes.css
doc/html
doc/*.html
doc/*.css
varnish (4.0.0-1) unstable; urgency=medium
The syntax of the VCL has changed. If upgrading from a previous version of
varnish, you will need to update your VCL before varnish will start.
For instructions on rewriting your VCL, please see the file
/usr/share/doc/varnish-doc/html/whats-new/upgrading.html in the varnish-doc
package, or https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html
for online documentation
-- Stig Sandbeck Mathisen <ssm@debian.org> Thu, 10 Apr 2014 13:53:53 +0200
varnish (2.1.3-2) lucid; urgency=low
Varnish will no longer start by default when installed. Edit
/etc/default/varnish, and set START=yes to enable varnishd at boot.
This may also affect you after upgrading if you never have changed
/etc/default/varnish, or if you accepted changes to /etc/default/varnish
during upgrade.
-- Stig Sandbeck Mathisen <ssm@debian.org> Thu, 29 Jul 2010 01:02:21 +0200
varnish (2.1.0-2) unstable; urgency=low
Varnish 2.1.0 provides authentication for the management port. The
packaging defaults now use this functionality.
The secret is used by "varnishd" and "varnishadm", and is stored in
the file /etc/varnish/secret by default. This file has been created
for you by the post installation script.
If you use varnishadm manually to manage your varnish instance, or
have changed /etc/default/varnish, you will need to add the option
"-S /etc/varnish/secret" to "varnishd" and "varnishadm".
-- Stig Sandbeck Mathisen <ssm@debian.org> Fri, 26 Mar 2010 10:38:21 +0100
# Configuration file for Varnish Cache.
#
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
# to be set from this shell script fragment.
#
# Note: If systemd is installed, this file is obsolete and ignored. You will
# need to copy /lib/systemd/system/varnish.service to /etc/systemd/system/ and
# edit that file.
# Should we start varnishd at boot? Set to "no" to disable.
START=yes
# Maximum number of open files (for ulimit -n)
NFILES=131072
# Maximum locked memory size (for ulimit -l)
# Used for locking the shared memory log in memory. If you increase log size,
# you need to increase this number as well
MEMLOCK=82000
DAEMON_OPTS="-a :6081 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"
usr/share/varnish
var/log/varnish
README
doc/changes.rst
bin/varnishd/builtin.vcl
#! /bin/sh
### BEGIN INIT INFO
# Provides: varnish
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start HTTP accelerator
# Description: This script provides a server-side cache
# to be run in front of a httpd and should
# listen on port 80 on a properly configured
# system
### END INIT INFO
# Source function library
. /lib/lsb/init-functions
NAME=varnishd
DESC="HTTP accelerator"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/varnishd
PIDFILE=/run/$NAME.pid
test -x $DAEMON || exit 0
# Include varnish defaults if available
if [ -f /etc/default/varnish ] ; then
. /etc/default/varnish
fi
# Open files (usually 1024, which is way too small for varnish)
ulimit -n ${NFILES:-131072}
# Maxiumum locked memory size for shared memory log
ulimit -l ${MEMLOCK:-82000}
# If $DAEMON_OPTS is not set at all in /etc/default/varnish, use minimal useful
# defaults (Backend at localhost:8080, a common place to put a locally
# installed application server.)
DAEMON_OPTS=${DAEMON_OPTS:--b localhost}
# Ensure we have a PATH
export PATH="${PATH:+$PATH:}/usr/sbin:/usr/bin:/sbin:/bin"
start_varnishd() {
log_daemon_msg "Starting $DESC" "$NAME"
output=$(/bin/tempfile -s.varnish)
if start-stop-daemon \
--start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- \
-P ${PIDFILE} ${DAEMON_OPTS} > ${output} 2>&1; then
log_end_msg 0
else
log_end_msg 1
cat $output
exit 1
fi
rm $output
}
disabled_varnishd() {
log_daemon_msg "Not starting $DESC" "$NAME"
log_progress_msg "disabled in /etc/default/varnish"
log_end_msg 0
}
stop_varnishd() {
log_daemon_msg "Stopping $DESC" "$NAME"
if start-stop-daemon \
--stop --quiet --pidfile $PIDFILE --retry 10 \
--exec $DAEMON; then
log_end_msg 0
else
log_end_msg 1
fi
if test -r $PIDFILE; then
read -r PID < $PIDFILE
if test ! -d /proc/$PID ; then
# stale pidfile
unset PID
rm -f $PIDFILE
fi
fi
}
reload_varnishd() {
log_daemon_msg "Reloading $DESC" "$NAME"
if /usr/share/varnish/reload-vcl -q; then
log_end_msg 0
else
log_end_msg 1
fi
}
status_varnishd() {
start-stop-daemon \
--status --quiet --pidfile $PIDFILE \
--exec $DAEMON
exit $?
}
configtest() {
$DAEMON ${DAEMON_OPTS} -C -n /tmp 2>/dev/null
if [ "$?" != 0 ]; then
$DAEMON ${DAEMON_OPTS} -C -n /tmp
return $?
fi
}
case "$1" in
start)
case "${START:-}" in
[Yy]es|[Yy]|1|[Tt]|[Tt]rue)
start_varnishd
;;
*)
disabled_varnishd
;;
esac
;;
stop)
stop_varnishd
;;
reload)
reload_varnishd
;;
status)
status_varnishd
;;
restart|force-reload)
if status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" 1>/dev/null; then
if ! configtest; then
log_failure_msg "Syntax check failed, not restarting"
exit 1
fi
fi
$0 stop
$0 start
;;
configtest)
configtest && log_success_msg "Syntax ok"
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload|configtest}"
exit 1
;;
esac
etc/varnish/default.vcl
usr/bin/*
usr/sbin/*
/usr/lib/varnish
usr/share/man
debian/*.service lib/systemd/system/
usr/share/doc/varnish/*.vcl
varnish: embedded-library usr/lib/varnish/libvgz.so: zlib
/var/log/varnish/varnish.log {
daily
rotate 7
missingok
compress
delaycompress
missingok
postrotate
if [ -d /run/systemd/system ]; then
systemctl -q is-active varnishlog.service || exit 0
fi
/usr/sbin/invoke-rc.d varnishlog reload > /dev/null
endscript
}
/var/log/varnish/varnishncsa.log {
daily
rotate 7
missingok
compress
delaycompress
missingok
postrotate
if [ -d /run/systemd/system ]; then
systemctl -q is-active varnishlog.service || exit 0
fi
/usr/sbin/invoke-rc.d varnishncsa reload > /dev/null
endscript
}
bin/varnishtest/varnishtest.1
bin/varnishncsa/varnishncsa.1
bin/varnishhist/varnishhist.1
bin/varnishstat/varnishstat.1
bin/varnishreplay/varnishreplay.1
bin/varnishadm/varnishadm.1
bin/varnishlog/varnishlog.1
bin/varnishtop/varnishtop.1
bin/varnishd/varnishd.1
man/vcl.7
bin/varnishsizes/varnishsizes.1
#!/bin/sh
# Postinst script for varnish.
# Stig Sandbeck Mathisen <ssm@debian.org>
set -e
set -u
# Settings
daemon_user="varnish"
log_user="varnishlog"
daemon_dir=/var/lib/varnish/$(uname -n)
log_dir="/var/log/varnish"
secret_file=/etc/varnish/secret
varnish_setup_user() {
if ! getent passwd $1 2>&1 >/dev/null; then
adduser --quiet --system --no-create-home --group $1
fi
}
varnish_create_storagedir() {
if ! [ -d "$daemon_dir" ]; then
install -o $daemon_user -g $daemon_user -d $daemon_dir
fi
}
varnish_setup_logdir() {
if ! dpkg-statoverride --list $log_dir >/dev/null; then
dpkg-statoverride --update --add $log_user $log_user 0750 $log_dir
fi
}
varnish_create_secret() {
if ! [ -f "${secret_file}" ]; then
if [ -f /proc/sys/kernel/random/uuid ]; then
install -m 0600 /proc/sys/kernel/random/uuid "${secret_file}"
else
install -m 0600 /dev/null "${secret_file}"
dd if=/dev/urandom count=1 bs=128 2>/dev/null \
| tr -dc "A-Za-z0-9" > "${secret_file}"
fi
fi
}
# varnish version 2.1.3-1 and older ran the log demons as root, we
# need to change the owner of the old logs for upgrading clients
upgrade_change_log_permissions() {
chown -Rhf ${log_user}: ${log_dir}
}
case ${1:-} in
configure)
varnish_setup_user $daemon_user
varnish_setup_user $log_user
varnish_create_storagedir
varnish_setup_logdir
varnish_create_secret
if dpkg --compare-versions "2.1.3-2" "gt-nl" "${2:-}" ; then
upgrade_change_log_permissions
fi
;;
esac
#DEBHELPER#
#!/bin/sh
set -e
case "$1" in
upgrade)
;;
remove|failed-upgrade|abort-install|abort-upgrade|disappear)
if dpkg-statoverride --list /var/log/varnish >/dev/null; then
dpkg-statoverride --remove /var/log/varnish || true
fi
if test -e /var/log/varnish ; then
rm -r /var/log/varnish > /dev/null 2>&1 || exit 78
fi
if test -e /var/lib/varnish; then
rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
fi
;;
purge)
if test -e /var/log/varnish; then
rm -r /var/log/varnish > /dev/null 2>&1 || exit 78
fi
if test -e /var/lib/varnish; then
rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
fi
rm -f /etc/varnish/secret
dpkg-statoverride --remove /var/log/varnish || true
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 64
esac
#DEBHELPER#
exit 0
[Unit]
Description=Varnish Cache, a high-performance HTTP accelerator
[Service]
Type=forking
LimitNOFILE=131072
LimitMEMLOCK=82000
ExecStartPre=/usr/sbin/varnishd -C -f /etc/varnish/default.vcl
ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
[Install]
WantedBy=multi-user.target
# Configuration file for varnishlog
#
# Note: If systemd is installed, this file is obsolete and ignored. You will
# need to copy /lib/systemd/system/varnishlog.service to /etc/systemd/system/
# and edit that file.
#
# Uncomment this to enable logging for varnish. Please make sure you have
# enough disk space for significant amounts of log data. To disable logging,
# set the variable to "0", "no", or leave it unset.
#
# Varnish log format, to be used by "varnishlog" or "varnishncsa"
# VARNISHLOG_ENABLED=1
#! /bin/sh
### BEGIN INIT INFO
# Provides: varnishlog
# Required-Start: $local_fs $remote_fs $network varnish
# Required-Stop: $local_fs $remote_fs $network varnish
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start HTTP accelerator log daemon
# Description: This script provides logging for varnish
### END INIT INFO
# Source function library
. /lib/lsb/init-functions
NAME=varnishlog
DESC="HTTP accelerator log deamon"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/$NAME
PIDFILE=/run/$NAME/$NAME.pid
LOGFILE=/var/log/varnish/varnish.log
USER=varnishlog
DAEMON_OPTS="-a -w ${LOGFILE} -D -P $PIDFILE"
# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi
# If unset, or set to "0" or "no", exit
if [ -z "${VARNISHLOG_ENABLED}" ] || \
[ "${VARNISHLOG_ENABLED}" = "0" ] || \
[ "${VARNISHLOG_ENABLED}" = "no" ]; then
exit 0;
fi
test -x $DAEMON || exit 0
start_varnishlog() {
output=$(/bin/tempfile -s.varnish)
log_daemon_msg "Starting $DESC" "$NAME"
create_pid_directory
if start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS} \
> ${output} 2>&1; then
log_end_msg 0
else
log_end_msg 1
cat $output
exit 1
fi
rm $output
}
stop_varnishlog(){
log_daemon_msg "Stopping $DESC" "$NAME"
if start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--retry 10 --exec $DAEMON; then
log_end_msg 0
else
log_end_msg 1
fi
}
reload_varnishlog(){
log_daemon_msg "Reloading $DESC" "$NAME"
if kill -HUP $(cat $PIDFILE) >/dev/null 2>&1; then
log_end_msg 0
else
log_end_msg 1
exit 1
fi
}
status_varnishlog(){
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
exit $?
}
create_pid_directory() {
install -o $USER -g $USER -d $(dirname $PIDFILE)
}
case "$1" in
start)
start_varnishlog
;;
stop)
stop_varnishlog
;;
reload)
reload_varnishlog
;;
status)
status_varnishlog
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}"
exit 1
;;
esac
# Configuration file for varnishncsa
#
# This shell script fragment is sourced by /etc/init.d/varnishncsa
#
# Note: If systemd is installed, this file is obsolete and ignored. You will
# need to copy /lib/systemd/system/varnishncsa.service to /etc/systemd/system/
# and edit that file.
#
# Uncomment this to enable logging for varnish. Please make sure you have
# enough disk space for significant amounts of log data. To disable logging,
# set the variable to "0", "no", or leave it unset.
#
# NCSA log format, to be used by HTTP log analyzers
# VARNISHNCSA_ENABLED=1
#
# If you want to add more arguments to varnishncsa, such as providing
# a different log format, you can override the DAEMON_OPTS variable
# from /etc/init.d/varnishncsa here.
# DAEMON_OPTS="-a -w ${LOGFILE} -D -P ${PIDFILE}"
#! /bin/sh
### BEGIN INIT INFO
# Provides: varnishncsa
# Required-Start: $local_fs $remote_fs $network varnish
# Required-Stop: $local_fs $remote_fs $network varnish
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start HTTP accelerator log daemon
# Description: This script provides logging for varnish
### END INIT INFO
# Source function library
. /lib/lsb/init-functions
NAME=varnishncsa
DESC="HTTP accelerator log deamon"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/$NAME
PIDFILE=/run/$NAME/$NAME.pid
LOGFILE=/var/log/varnish/varnishncsa.log
USER=varnishlog
DAEMON_OPTS="-a -w ${LOGFILE} -D -P ${PIDFILE}"
# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi
# If unset, or set to "0" or "no", exit
if [ -z "${VARNISHNCSA_ENABLED}" ] || \
[ "${VARNISHNCSA_ENABLED}" = "0" ] || \
[ "${VARNISHNCSA_ENABLED}" = "no" ]; then
exit 0;
fi
test -x $DAEMON || exit 0
start_varnishncsa() {
output=$(/bin/tempfile -s.varnish)
log_daemon_msg "Starting $DESC" "$NAME"
create_pid_directory
if start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS} \
> ${output} 2>&1; then
log_end_msg 0
else
log_end_msg 1
cat $output
exit 1
fi
rm $output
}
stop_varnishncsa(){
log_daemon_msg "Stopping $DESC" "$NAME"
if start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--retry 10 --exec $DAEMON; then
log_end_msg 0
else
log_end_msg 1
fi
}
reload_varnishncsa(){
log_daemon_msg "Reloading $DESC" "$NAME"
if kill -HUP $(cat $PIDFILE) >/dev/null 2>&1; then
log_end_msg 0
else
log_end_msg 1
exit 1
fi
}
status_varnishncsa(){
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
exit $?
}
create_pid_directory() {
install -o $USER -g $USER -d $(dirname $PIDFILE)
}
case "$1" in
start)
start_varnishncsa
;;
stop)
stop_varnishncsa
;;
reload)
reload_varnishncsa
;;
status)
status_varnishncsa
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}"
exit 1
;;
esac
[Unit]
Description=Varnish HTTP accelerator log daemon
After=varnish.service
[Service]
User=varnishlog
ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
[Unit]
Description=Varnish HTTP accelerator log daemon
After=varnish.service
[Service]
User=varnishlog
ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
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