diff options
Diffstat (limited to 'extra/php')
-rw-r--r-- | extra/php/PKGBUILD | 7 | ||||
-rw-r--r-- | extra/php/rc.d.php-fpm | 34 |
2 files changed, 31 insertions, 10 deletions
diff --git a/extra/php/PKGBUILD b/extra/php/PKGBUILD index 5c2531f8d..ee8e0a17c 100644 --- a/extra/php/PKGBUILD +++ b/extra/php/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 115705 2011-03-19 15:53:37Z pierre $ +# $Id: PKGBUILD 118966 2011-04-09 20:51:34Z pierre $ # Maintainer: Pierre Schmitz <pierre@archlinux.de> pkgbase=php @@ -24,7 +24,7 @@ pkgname=('php' 'php-tidy' 'php-xsl') pkgver=5.3.6 -pkgrel=1 +pkgrel=2 _suhosinver=${pkgver}-0.9.10 arch=('i686' 'x86_64') license=('PHP') @@ -41,7 +41,7 @@ md5sums=('2286f5a82a6e8397955a0025c1c2ad98' 'fff1a38877142f3ae6036dbe5a85d0a6' '39eaa70d276fc3d45d6bcf6cd5ae1106' '96ca078be6729b665be8a865535a97bf' - 'b136a184dd055c559a03eb8bac562a3c' + 'b01be5f816988fcee7e78225836e5e27' 'd50ff349da08110a7cc8c691ce2d0423' '07c4e412909ac65a44ec90e7a2c4bade') @@ -261,7 +261,6 @@ package_php-fpm() { install -D -m644 ${srcdir}/build-fpm/sapi/fpm/php-fpm.conf ${pkgdir}/etc/php/php-fpm.conf install -D -m755 ${srcdir}/rc.d.php-fpm ${pkgdir}/etc/rc.d/php-fpm install -D -m644 ${srcdir}/logrotate.d.php-fpm ${pkgdir}/etc/logrotate.d/php-fpm - install -d -m755 ${pkgdir}/var/run/php-fpm install -d -m755 ${pkgdir}/etc/php/fpm.d } diff --git a/extra/php/rc.d.php-fpm b/extra/php/rc.d.php-fpm index 35cf35652..54bcf4d5b 100644 --- a/extra/php/rc.d.php-fpm +++ b/extra/php/rc.d.php-fpm @@ -6,9 +6,7 @@ wait_for_pid () { try=0 - while test $try -lt 35 ; do - case "$1" in 'created') if [ -f "$2" ] ; then @@ -16,7 +14,6 @@ wait_for_pid () { break fi ;; - 'removed') if [ ! -f "$2" ] ; then try='' @@ -28,15 +25,38 @@ wait_for_pid () { stat_append '.' try=`expr $try + 1` sleep 1 - done - } -[ -d /var/run/php-fpm ] || install -d -m755 /var/run/php-fpm +test_config() { + stat_busy 'Checking configuration' + if [ $(id -u) -ne 0 ]; then + stat_append '(This script must be run as root)' + stat_die + fi + + if [ ! -r /etc/php/php-fpm.conf ]; then + stat_append '(/etc/php/php-fpm.conf not found)' + stat_die + fi + + local test=$(/usr/sbin/php-fpm -t 2>&1) + if [ $? -gt 0 ]; then + stat_append '(error in /etc/php/php-fpm.conf)' + stat_die + elif echo $test | grep -qi 'error'; then + stat_append '(error in /etc/php/php.ini)' + stat_die + fi + + [ -d /var/run/php-fpm ] || install -d -m755 /var/run/php-fpm + + stat_done +} case "$1" in start) + test_config stat_busy 'Starting php-fpm' /usr/sbin/php-fpm @@ -58,6 +78,7 @@ case "$1" in ;; stop) + test_config stat_busy 'Gracefully shutting down php-fpm' if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then @@ -105,6 +126,7 @@ case "$1" in ;; reload) + test_config stat_busy 'Reload service php-fpm' if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then |