Zap duplicate example VCL files, improve varnishreload(1)

- use UTC in timestamps
- provide EXAMPLES section
- improve manual wording
This commit is contained in:
kn 2020-11-07 17:17:21 +00:00
parent 5d8ffc9a33
commit 9caee13623
4 changed files with 36 additions and 24 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.54 2020/10/08 12:34:23 kn Exp $
# $OpenBSD: Makefile,v 1.55 2020/11/07 17:17:21 kn Exp $
COMMENT = high-performance HTTP accelerator
DISTNAME = varnish-6.5.1
REVISION = 0
CATEGORIES = www
@ -42,7 +43,8 @@ AUTORECONF = ./autogen.sh
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib ${LDFLAGS}" \
PYTHON="${MODPY_BIN}"
CONFIGURE_ARGS = --with-rst2man=rst2man${MODPY_BIN_SUFFIX} \
CONFIGURE_ARGS = --docdir=${PREFIX}/share/examples/varnish \
--with-rst2man=rst2man${MODPY_BIN_SUFFIX} \
--with-sphinx-build=sphinx-build${MODPY_BIN_SUFFIX}
TEST_TARGET = check
@ -59,9 +61,6 @@ pre-build:
post-install:
${SUBST_PROGRAM} ${FILESDIR}/varnishreload ${PREFIX}/bin/varnishreload
${SUBST_MAN} ${FILESDIR}/varnishreload.1 ${PREFIX}/man/man1/varnishreload.1
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/varnish
${INSTALL_DATA} ${WRKDIST}${SYSCONFDIR}/{example,builtin}.vcl \
${PREFIX}/share/examples/varnish
rm -f ${PREFIX}/lib/varnish/{vmods,}/*.{a,la}
.include <bsd.port.mk>

View File

@ -1,18 +1,19 @@
#!/bin/sh
#
# $OpenBSD: varnishreload,v 1.2 2020/01/18 11:34:34 kn Exp $
# $OpenBSD: varnishreload,v 1.3 2020/11/07 17:17:22 kn Exp $
#
# Reload active VCL.
set -Cefu
if getopts '' _ || [ $# -ge 2 ]; then
if [ $# -ge 2 ] || getopts '' _
then
printf 'usage:\t%s [file]\n' "${0##*/}" 1>&2
exit 1
fi
FILE=${1:-${SYSCONFDIR}/varnish/default.vcl}
NAME=${FILE##*/}
NAME=${NAME%%.*}_$(date +%Y%m%d%H%M%S)
NAME=${NAME%%.*}_$(date -u +%Y%m%d%H%M%S)
${TRUEPREFIX}/bin/varnishadm -- vcl.load "$NAME" "$FILE"
${TRUEPREFIX}/bin/varnishadm -- vcl.use "$NAME"

View File

@ -1,5 +1,5 @@
.\" $OpenBSD: varnishreload.1,v 1.2 2020/01/18 11:34:34 kn Exp $
.Dd $Mdocdate: January 18 2020 $
.\" $OpenBSD: varnishreload.1,v 1.3 2020/11/07 17:17:22 kn Exp $
.Dd $Mdocdate: November 7 2020 $
.Dt VARNISHRELOAD 1
.Os
.Sh NAME
@ -11,18 +11,34 @@
.Sh DESCRIPTION
The
.Nm
utility loads a new Varnish configuration and activates it iff valid.
If no file is given, the installation default is used.
utility loads a new Varnish configuration and activates it iff valid using
.Xr varnishadm 1 .
If no file is given the installation default is used.
.Pp
The new VCL name consists of the file name and time of reload
in order to maintain a meaningful, ordered list of configuations.
The new VCL name consists of the file name and a timestamp (UTC) to maintain a
meaningful and ordered list of configuations.
.Sh FILES
.Bl -tag -width Ds
.Bl -tag -width ${SYSCONFDIR}/varnish/default.vcl
.It Pa ${SYSCONFDIR}/varnish/default.vcl
The default VCL file.
default VCL file
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
List available configurations, reload the default one and verify:
.Bd -literal -offset indent
# varnishadm vcl.list
active auto warm 0 boot
# varnishreload
VCL compiled.
VCL 'default_20201107165406' now active
# varnishadm vcl.list
available auto warm 0 boot
active auto warm 0 default_20201107165406
.Ed
.Sh SEE ALSO
.Xr varnishadm 1 ,
.Xr varnishd 1

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.18 2020/10/08 12:34:23 kn Exp $
@comment $OpenBSD: PLIST,v 1.19 2020/11/07 17:17:22 kn Exp $
@newgroup _varnish:625
@newuser _varnish:625:_varnish:daemon:Varnish Cache:/var/varnish:/bin/sh
@rcscript ${RCDIR}/varnishd
@ -140,17 +140,13 @@ lib/varnish/vmods/
share/aclocal/
share/aclocal/varnish-legacy.m4
share/aclocal/varnish.m4
share/doc/varnish/
share/doc/varnish/builtin.vcl
share/doc/varnish/example.vcl
@exec-add mkdir -p /var/varnish
@extraunexec rm -fr /var/varnish
share/examples/varnish/
@sample ${SYSCONFDIR}/varnish/
share/examples/varnish/builtin.vcl
@sample ${SYSCONFDIR}/varnish/builtin.vcl
share/examples/varnish/example.vcl
@sample ${SYSCONFDIR}/varnish/example.vcl
@exec-add mkdir -p /var/varnish
@extraunexec rm -fr /var/varnish
@sample ${SYSCONFDIR}/varnish/default.vcl
share/varnish/
share/varnish/vcl/
share/varnish/vcl/devicedetect.vcl