From 4856a9dc654d8a7430f078586a507b3813a90b40 Mon Sep 17 00:00:00 2001 From: Ingvar Hagelund Date: Wed, 3 Feb 2016 15:28:37 +0100 Subject: [PATCH] Added patch from upstream, daemonizing varnishd in systemd, as it handles SIGHUP otherwice when running foregrounded under systemd --- varnish-4.1-systemd_daemon.git75955e8.patch | 87 +++++++++++++++++++++ varnish.spec | 9 ++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 varnish-4.1-systemd_daemon.git75955e8.patch diff --git a/varnish-4.1-systemd_daemon.git75955e8.patch b/varnish-4.1-systemd_daemon.git75955e8.patch new file mode 100644 index 0000000..66746bc --- /dev/null +++ b/varnish-4.1-systemd_daemon.git75955e8.patch @@ -0,0 +1,87 @@ +From 75955e86c37f69a4421a1fa49102790bb25ea7d1 Mon Sep 17 00:00:00 2001 +From: Lasse Karstensen +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] diff --git a/varnish.spec b/varnish.spec index 79544fd..d325a0d 100644 --- a/varnish.spec +++ b/varnish.spec @@ -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 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 4.1.1-1 - New upstream release - Rebased sphinx build patch