Accepting request 1004422 from home:bmwiedemann:branches:server:http

- Fix logrotate
- Add service reload

There is still trouble with systemctl stop varnish that takes too long.

OBS-URL: https://build.opensuse.org/request/show/1004422
OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=114
This commit is contained in:
Jan Engelhardt 2022-09-18 21:03:45 +00:00 committed by Git OBS Bridge
parent 294631b11c
commit e21e452795
5 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Sep 18 03:26:45 UTC 2022 - Bernhard Wiedemann <bwiedemann@suse.com>
- Fix logrotate
- Add service reload
-------------------------------------------------------------------
Fri Aug 12 10:32:58 UTC 2022 - Jan Engelhardt <jengelh@inai.de>

View File

@ -5,6 +5,6 @@
sharedscripts
delaycompress
postrotate
/etc/init.d/varnish reload
/usr/bin/systemctl restart varnishlog
endscript
}

View File

@ -19,6 +19,7 @@ RestrictRealtime=true
EnvironmentFile=/etc/sysconfig/varnish
PIDFile=/var/run/varnishd.pid
ExecStart=/usr/sbin/varnishd -P /var/run/varnishd.pid -F $VARNISHD_PARAMS
ExecReload=/usr/sbin/varnish_reload_vcl
[Install]
WantedBy=multi-user.target

View File

@ -37,6 +37,7 @@ Source3: varnish.sysconfig
Source5: varnish.logrotate
Source7: varnish.service
Source8: varnishlog.service
Source9: varnish_reload_vcl
Patch1: varnish-5.1.2-add-fallthrough-comments.patch
Patch2: uninit.patch
BuildRequires: libxslt-devel
@ -120,6 +121,7 @@ install -Dpm 0644 "%SOURCE8" "$b/%_unitdir/varnishlog.service"
mkdir -p "$b/%_sbindir"
ln -s service "$b/%_sbindir/rcvarnish"
ln -s service "$b/%_sbindir/rcvarnishlog"
install -Dpm 0755 "%SOURCE9" "$b/%_sbindir/varnish_reload_vcl"
#
##config files
mkdir -p "$b/%_sysconfdir/%name"

11
varnish_reload_vcl Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Generate a unique timestamp ID for this version of the VCL
TIME=$(date +%s)
vadm="varnishadm -S /var/cache/varnish/varnishd/_.secret -T 127.0.0.1:6082"
# Load the file into memory
$vadm vcl.load varnish_$TIME /etc/varnish/vcl.conf
# Active this Varnish config
$vadm vcl.use varnish_$TIME