[Pkg-php-commits] [php/debian-sid] Set initial chdir to /tmp in www pool, rename main configuration file to php-fpm.conf to match upstream, enable error reporting in init.d file and patch FPM SAPI to use Debian php-fpm.conf as default (Closes: #601243)
Ondřej Surý
ondrej at sury.org
Thu Mar 17 15:58:18 UTC 2011
---
debian/control | 1 +
debian/patches/php-fpm-sysconfdir.patch | 11 +++++++++++
debian/patches/series | 1 +
debian/php5-fpm.init | 10 ++++++++++
debian/php5-fpm.postinst | 2 ++
debian/php5-fpm.postrm | 9 +++++++++
debian/php5-fpm.preinst | 9 +++++++++
debian/rules | 3 ++-
8 files changed, 45 insertions(+), 1 deletions(-)
create mode 100644 debian/patches/php-fpm-sysconfdir.patch
create mode 100644 debian/php5-fpm.postrm
create mode 100644 debian/php5-fpm.preinst
diff --git a/debian/control b/debian/control
index a59ff77..60ddc08 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: OndÅej Surý <ondrej at debian.org>,
Sean Finney <seanius at debian.org>,
Thijs Kinkhorst <thijs at debian.org>,
Raphael Geissert <geissert at debian.org>
+Pre-Depends: dpkg (>= 1.15.7.2)
Build-Depends: apache2-prefork-dev,
autoconf (>= 2.63),
automake (>= 1.11) | automake1.11,
diff --git a/debian/patches/php-fpm-sysconfdir.patch b/debian/patches/php-fpm-sysconfdir.patch
new file mode 100644
index 0000000..3e641c3
--- /dev/null
+++ b/debian/patches/php-fpm-sysconfdir.patch
@@ -0,0 +1,11 @@
+--- a/sapi/fpm/fpm/fpm_conf.c
++++ b/sapi/fpm/fpm/fpm_conf.c
+@@ -1182,7 +1182,7 @@ int fpm_conf_init_main(int test_conf) /*
+ char *tmp;
+
+ if (fpm_globals.prefix == NULL) {
+- spprintf(&tmp, 0, "%s/php-fpm.conf", PHP_SYSCONFDIR);
++ spprintf(&tmp, 0, "%s/php5/fpm/php-fpm.conf", PHP_SYSCONFDIR);
+ } else {
+ spprintf(&tmp, 0, "%s/etc/php-fpm.conf", fpm_globals.prefix);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 03f8989..d720d90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -59,3 +59,4 @@ fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
fix-segfault-when-node-is-NULL-in-simplexml.patch
fix-segfault-when-using-several-cloned-intl-objects.patch
debbug#615770.patch
+php-fpm-sysconfdir.patch
diff --git a/debian/php5-fpm.init b/debian/php5-fpm.init
index 945bd09..b75df3d 100644
--- a/debian/php5-fpm.init
+++ b/debian/php5-fpm.init
@@ -22,11 +22,21 @@ SSD_OPTIONS="--oknodo --quiet --pidfile $FPM_PID --exec $FPM_CMD"
. /lib/lsb/init-functions
+# Test the correctness of the config file
+FPM_ERROR=$($FPM_CMD $FPM_OPTIONS -t | grep "\[ERROR\]")
+
+if [ -n "${FPM_ERROR}" ]; then
+ echo "Please check your configuration file..."
+ echo $FPM_ERROR
+ exit 1
+fi
+
case "$1" in
start)
log_begin_msg "Starting $DAEMON..."
/sbin/start-stop-daemon --start $SSD_OPTIONS -- $FPM_OPTIONS
+
log_end_msg $?
;;
stop)
diff --git a/debian/php5-fpm.postinst b/debian/php5-fpm.postinst
index 19246bf..3c06910 100644
--- a/debian/php5-fpm.postinst
+++ b/debian/php5-fpm.postinst
@@ -4,6 +4,8 @@ set -e
#DEBHELPER#
+dpkg-maintscript-helper mv_conffile /etc/php5/fpm/main.conf /etc/php5/fpm/php-fpm.conf 5.3.5-1 -- "$@"
+
if [ "$1" != "configure" ]; then
exit 0
fi
diff --git a/debian/php5-fpm.postrm b/debian/php5-fpm.postrm
new file mode 100644
index 0000000..267791b
--- /dev/null
+++ b/debian/php5-fpm.postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER
+
+dpkg-maintscript-helper mv_conffile /etc/php5/fpm/main.conf /etc/php5/fpm/php-fpm.conf 5.3.5-1 -- "$@"
+
+exit 0
diff --git a/debian/php5-fpm.preinst b/debian/php5-fpm.preinst
new file mode 100644
index 0000000..267791b
--- /dev/null
+++ b/debian/php5-fpm.preinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER
+
+dpkg-maintscript-helper mv_conffile /etc/php5/fpm/main.conf /etc/php5/fpm/php-fpm.conf 5.3.5-1 -- "$@"
+
+exit 0
diff --git a/debian/rules b/debian/rules
index 0a561b4..f1c4fb4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -526,9 +526,10 @@ install: build
cp fpm-build/sapi/fpm/php-fpm.8 debian/php5-fpm/usr/share/man/man8/php5-fpm.8
# we don't want the pool definitions on the main file itself:
sed -r '/('"'"'|\[)www('"'"'|\])/Q' < fpm-build/sapi/fpm/php-fpm.conf > \
- debian/php5-fpm/etc/php5/fpm/main.conf
+ debian/php5-fpm/etc/php5/fpm/php-fpm.conf
# extract the first pool, called "www," from the config file:
sed -nr '/('"'"'|\[)www('"'"'|\])/{h;p;d};x;/www/{x;p}' < fpm-build/sapi/fpm/php-fpm.conf \
+ | sed -e 's/;chdir = \/var\/www/chdir = \"/tmp"' \
> debian/php5-fpm/etc/php5/fpm/pool.d/www.conf
# move and install -dev files
--
1.7.1
More information about the Pkg-php-commits
mailing list