[apache2] 02/02: Use pthread mutexes on linux
Stefan Fritsch
sf at moszumanska.debian.org
Sun Apr 10 12:05:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
sf pushed a commit to branch master
in repository apache2.
commit 4796a324d594f26693b77661ca1353edc6497ed5
Author: Stefan Fritsch <sf at sfritsch.de>
Date: Sun Apr 10 14:03:27 2016 +0200
Use pthread mutexes on linux
kfreebsd/hurd lack robust pthred mutexes. Therefore we need to keep
using fcntl there. For fcnl, we need to specify the directory in
apache2.conf explicitly, to support multi-instance setups. To achieve
this, we add a marker to apache2.conf that is removed or replaced by
a '#' during build, depending on the OS.
---
debian/apache2.install | 5 ++++-
debian/changelog | 2 ++
debian/clean | 1 +
debian/config-dir/{apache2.conf => apache2.conf.in} | 2 +-
debian/rules | 15 ++++++++++++++-
5 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/debian/apache2.install b/debian/apache2.install
index c774b32..4972511 100644
--- a/debian/apache2.install
+++ b/debian/apache2.install
@@ -1,5 +1,8 @@
debian/bash_completion/a2enmod /usr/share/bash-completion/completions/
-debian/config-dir/* /etc/apache2
+debian/config-dir/*.conf /etc/apache2
+debian/config-dir/*-available /etc/apache2
+debian/config-dir/magic /etc/apache2
+debian/config-dir/envvars /etc/apache2
debian/a2enmod /usr/sbin
debian/apache2ctl /usr/sbin
debian/a2query /usr/sbin
diff --git a/debian/changelog b/debian/changelog
index 324a29f..19e96b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ apache2 (2.4.20-1) UNRELEASED; urgency=medium
* Correct systemd-sysv-generator behavior by customizing some parameters.
This fixes 'systemctl status' returning incorrect results. Thanks to
Pierre-André MOREY for the patch. LP: #1488962
+ * On Linux, use pthread mutexes. On kfreebsd/hurd, continue using fctnl
+ because they lack robust pthred mutexes. LP: #1565744, #1527044
-- Stefan Fritsch <sf at debian.org> Sat, 09 Apr 2016 13:41:04 +0200
diff --git a/debian/clean b/debian/clean
index ebbc63d..d49752e 100644
--- a/debian/clean
+++ b/debian/clean
@@ -11,6 +11,7 @@ debian/apache2-suexec-pristine.links
debian/apache2-suexec-pristine.dirs
debian/apache2-suexec-pristine.lintian-overrides
debian/a2query
+debian/config-dir/apache2.conf
debian/manpages/a2query.8
debian/manpages/dh_apache2.1
debian/debhelper/dh_apache2
diff --git a/debian/config-dir/apache2.conf b/debian/config-dir/apache2.conf.in
similarity index 99%
rename from debian/config-dir/apache2.conf
rename to debian/config-dir/apache2.conf.in
index baf6d8a..22e8cc4 100644
--- a/debian/config-dir/apache2.conf
+++ b/debian/config-dir/apache2.conf.in
@@ -71,7 +71,7 @@
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
-Mutex file:${APACHE_LOCK_DIR} default
+___MUTEX___Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
diff --git a/debian/rules b/debian/rules
index e9f453d..d08e825 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,7 +85,20 @@ override_dh_auto_configure: generate-maintainer-scripts prebuild-checks support/
LTFLAGS="$(AP2_LTFLAGS)"
-override_dh_install: clean-config-vars prepare-scripts
+debian/config-dir/apache2.conf: debian/config-dir/apache2.conf.in
+ @# Sanity check that the marker is actually there
+ grep -q ___MUTEX___ $<
+ifeq "$(DEB_BUILD_ARCH_OS)" "linux"
+ @# On linux, we use the default pthread mutex. Comment out
+ @# Mutex directive.
+ perl -p -e 's,___MUTEX___,#,' < $< > $@
+else
+ @# On kfreebsd/hurd, pthread mutexes are not robust. There, we need to
+ @# use fcntl and set the directory explicitly for multi-instance setups.
+ perl -p -i -e 's,___MUTEX___,,' < $< > $@
+endif
+
+override_dh_install: clean-config-vars prepare-scripts debian/config-dir/apache2.conf
dh_install --list-missing
override_dh_fixperms-arch:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apache2.git
More information about the Pkg-apache-commits
mailing list