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