From e21e4527954326f33d54d1b0010469c084ff74919161d95691209db3f1b0b9f8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 18 Sep 2022 21:03:45 +0000 Subject: [PATCH 1/2] 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 --- varnish.changes | 6 ++++++ varnish.logrotate | 2 +- varnish.service | 1 + varnish.spec | 2 ++ varnish_reload_vcl | 11 +++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 varnish_reload_vcl diff --git a/varnish.changes b/varnish.changes index 2c86073..b34cedf 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Sep 18 03:26:45 UTC 2022 - Bernhard Wiedemann + +- Fix logrotate +- Add service reload + ------------------------------------------------------------------- Fri Aug 12 10:32:58 UTC 2022 - Jan Engelhardt diff --git a/varnish.logrotate b/varnish.logrotate index d17902d..5ff8afb 100644 --- a/varnish.logrotate +++ b/varnish.logrotate @@ -5,6 +5,6 @@ sharedscripts delaycompress postrotate - /etc/init.d/varnish reload + /usr/bin/systemctl restart varnishlog endscript } diff --git a/varnish.service b/varnish.service index 2d82d08..5169cf6 100644 --- a/varnish.service +++ b/varnish.service @@ -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 diff --git a/varnish.spec b/varnish.spec index f41b3fa..bc40f00 100644 --- a/varnish.spec +++ b/varnish.spec @@ -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" diff --git a/varnish_reload_vcl b/varnish_reload_vcl new file mode 100644 index 0000000..be2695f --- /dev/null +++ b/varnish_reload_vcl @@ -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 From c765a642a6fd83917473d7bb27a96870a559195537a5b5babf83f4cf9d46f0b7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 19 Sep 2022 07:18:07 +0000 Subject: [PATCH 2/2] Accepting request 1004526 from home:bmwiedemann:branches:server:http Fix varnish.service stop OBS-URL: https://build.opensuse.org/request/show/1004526 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=115 --- varnish.changes | 5 +++++ varnish.service | 1 + 2 files changed, 6 insertions(+) diff --git a/varnish.changes b/varnish.changes index b34cedf..32e5ed5 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 19 02:44:04 UTC 2022 - Bernhard Wiedemann + +- Fix varnish.service stop + ------------------------------------------------------------------- Sun Sep 18 03:26:45 UTC 2022 - Bernhard Wiedemann diff --git a/varnish.service b/varnish.service index 5169cf6..83c859e 100644 --- a/varnish.service +++ b/varnish.service @@ -20,6 +20,7 @@ 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 +KillMode=mixed [Install] WantedBy=multi-user.target