Added patch from upstream, daemonizing varnishd in systemd, as

it handles SIGHUP otherwice when running foregrounded under systemd
This commit is contained in:
Ingvar Hagelund 2016-02-03 15:28:37 +01:00
parent 741f0ce2c6
commit 4856a9dc65
2 changed files with 95 additions and 1 deletions

View File

@ -0,0 +1,87 @@
From 75955e86c37f69a4421a1fa49102790bb25ea7d1 Mon Sep 17 00:00:00 2001
From: Lasse Karstensen <lkarsten@varnish-software.com>
Date: Mon, 1 Feb 2016 14:05:47 +0100
Subject: [PATCH] Revert removal of type=forking.
In fbc85bb3 the use of type=forking was removed. This made #1794
reappear, as these tools when not daemonized exists when receiving
a SIGHUP.
This is clearly suboptimal for log rotation.
Roll back this in the packages for now.
---
debian/varnishlog.service | 4 +++-
debian/varnishncsa.service | 4 +++-
redhat/varnishlog.service | 4 +++-
redhat/varnishncsa.service | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/debian/varnishlog.service b/debian/varnishlog.service
index 7e54a4e..19e60fa 100644
--- a/debian/varnishlog.service
+++ b/debian/varnishlog.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator logging daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishlog.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
+ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/debian/varnishncsa.service b/debian/varnishncsa.service
index e8e1d28..ba22f0f 100644
--- a/debian/varnishncsa.service
+++ b/debian/varnishncsa.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator log daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishncsa.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
+ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/redhat/varnishlog.service b/redhat/varnishlog.service
index 7e54a4e..19e60fa 100644
--- a/redhat/varnishlog.service
+++ b/redhat/varnishlog.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator logging daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishlog.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
+ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/redhat/varnishncsa.service b/redhat/varnishncsa.service
index e8e1d28..ba22f0f 100644
--- a/redhat/varnishncsa.service
+++ b/redhat/varnishncsa.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator log daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishncsa.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
+ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]

View File

@ -12,7 +12,7 @@
Summary: High-performance HTTP accelerator
Name: varnish
Version: 4.1.1
Release: 1%{?v_rc}%{?dist}
Release: 2%{?v_rc}%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://www.varnish-cache.org/
@ -23,6 +23,7 @@ Patch2: varnish-4.0.3_fix_Werror_el6.patch
Patch3: varnish-4.0.3_fix_python24.el5.patch
Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch
Patch6: varnish-4.1.0.fix_find-provides.patch
Patch7: varnish-4.1-systemd_daemon.git75955e8.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# To build from git, start with a make dist, see redhat/README.redhat
@ -140,6 +141,7 @@ Minimal selinux policy for running varnish4
%setup -q -n varnish-%{version}%{?vd_rc}
tar xvzf %SOURCE1
ln -s pkg-varnish-cache-%{commit1}/redhat redhat
ln -s pkg-varnish-cache-%{commit1}/debian debian
%patch1 -p0
%if 0%{?rhel} <= 6 && 0%{?fedora} <= 12
%patch2 -p0
@ -151,6 +153,7 @@ ln -s pkg-varnish-cache-%{commit1}/redhat redhat
%patch4 -p0
%endif
%patch6 -p0
%patch7 -p1
%build
%if 0%{?rhel} == 6
@ -398,6 +401,10 @@ fi
%endif
%changelog
* Wed Feb 03 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> 4.1.1-2
- Added patch from upstream, daemonizing varnishd in systemd, as
it handles SIGHUP otherwice when running foregrounded under systemd
* Fri Jan 29 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> 4.1.1-1
- New upstream release
- Rebased sphinx build patch