diff options
author | root <root@rshg054.dnsready.net> | 2012-06-04 00:01:23 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-06-04 00:01:23 +0000 |
commit | 1e6588d64f084decf287a58b7ff93ff0ce4d0446 (patch) | |
tree | 29bf5b8778e1eb67871d9e6e8bb6e205bdde5db7 /extra/php | |
parent | 80053e720288b6205a59c52c1b31c14a0f830989 (diff) |
Mon Jun 4 00:01:23 UTC 2012
Diffstat (limited to 'extra/php')
-rw-r--r-- | extra/php/PKGBUILD | 17 | ||||
-rw-r--r-- | extra/php/logrotate.d.php-fpm | 4 | ||||
-rw-r--r-- | extra/php/php-fpm.conf.in.patch | 4 | ||||
-rw-r--r-- | extra/php/php-fpm.install | 9 | ||||
-rw-r--r-- | extra/php/php-fpm.service | 13 | ||||
-rw-r--r-- | extra/php/php-fpm.tmpfiles | 1 | ||||
-rw-r--r-- | extra/php/rc.d.php-fpm | 32 |
7 files changed, 48 insertions, 32 deletions
diff --git a/extra/php/PKGBUILD b/extra/php/PKGBUILD index 35039e75b..2796f3f38 100644 --- a/extra/php/PKGBUILD +++ b/extra/php/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 158788 2012-05-09 18:48:29Z pierre $ +# $Id: PKGBUILD 160455 2012-06-02 08:38:48Z pierre $ # Maintainer: Pierre Schmitz <pierre@archlinux.de> pkgbase=php @@ -22,7 +22,7 @@ pkgname=('php' 'php-tidy' 'php-xsl') pkgver=5.4.3 -pkgrel=1 +pkgrel=4 arch=('i686' 'x86_64') license=('PHP') url='http://www.php.net' @@ -32,13 +32,15 @@ makedepends=('apache' 'imap' 'postgresql-libs' 'libldap' 'postfix' 'libvpx' 'curl' 'libxslt' 'openssl' 'bzip2' 'db' 'gmp' 'freetype2') source=("http://www.php.net/distributions/${pkgbase}-${pkgver}.tar.bz2" 'php.ini.patch' 'apache.conf' 'rc.d.php-fpm' 'php-fpm.conf.in.patch' - 'logrotate.d.php-fpm') + 'logrotate.d.php-fpm' 'php-fpm.service' 'php-fpm.tmpfiles') md5sums=('51f9488bf8682399b802c48656315cac' '0b0bc7a917fc592bdf11dcd3c5c255e9' 'dec2cbaad64e3abf4f0ec70e1de4e8e9' - 'b01be5f816988fcee7e78225836e5e27' - '59b3a25f9eb3afc02f1adf9ee699808c' - '07c4e412909ac65a44ec90e7a2c4bade') + 'aabda9f3f2f8b9d8fdc9558c31c718db' + '825e580dd5708d959b50944afa1b12b6' + 'f56b5bb7e93c802ae8519182fbea3387' + '86c73d481f3099e740e602869bacf637' + 'c60343df74f8e1afb13b084d5c0e47ed') build() { phpconfig="--srcdir=../${pkgbase}-${pkgver} \ @@ -233,6 +235,7 @@ package_php-fpm() { pkgdesc='FastCGI Process Manager for PHP' depends=('php') backup=('etc/php/php-fpm.conf') + install='php-fpm.install' install -D -m755 ${srcdir}/build-fpm/sapi/fpm/php-fpm ${pkgdir}/usr/sbin/php-fpm install -D -m644 ${srcdir}/build-fpm/sapi/fpm/php-fpm.8 ${pkgdir}/usr/share/man/man8/php-fpm.8 @@ -240,6 +243,8 @@ package_php-fpm() { 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}/etc/php/fpm.d + install -D -m644 ${srcdir}/php-fpm.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf + install -D -m644 ${srcdir}/php-fpm.service ${pkgdir}/usr/lib/systemd/system/php-fpm.service } package_php-embed() { diff --git a/extra/php/logrotate.d.php-fpm b/extra/php/logrotate.d.php-fpm index 7a1ba2597..ac2d92a36 100644 --- a/extra/php/logrotate.d.php-fpm +++ b/extra/php/logrotate.d.php-fpm @@ -1,6 +1,8 @@ /var/log/php-fpm.log { missingok + notifempty + delaycompress postrotate - /etc/rc.d/php-fpm logrotate >/dev/null || true + kill -USR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true endscript } diff --git a/extra/php/php-fpm.conf.in.patch b/extra/php/php-fpm.conf.in.patch index 4e0f4a888..0b17182fd 100644 --- a/extra/php/php-fpm.conf.in.patch +++ b/extra/php/php-fpm.conf.in.patch @@ -14,7 +14,7 @@ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ ; Default Value: none -;pid = run/php-fpm.pid -+pid = run/php-fpm/php-fpm.pid ++pid = /run/php-fpm/php-fpm.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written @@ -24,7 +24,7 @@ ; Note: This value is mandatory. -listen = 127.0.0.1:9000 +;listen = 127.0.0.1:9000 -+listen = /var/run/php-fpm/php-fpm.sock ++listen = /run/php-fpm/php-fpm.sock ; Set listen(2) backlog. ; Default Value: 128 (-1 on FreeBSD and OpenBSD) diff --git a/extra/php/php-fpm.install b/extra/php/php-fpm.install new file mode 100644 index 000000000..41fc37c22 --- /dev/null +++ b/extra/php/php-fpm.install @@ -0,0 +1,9 @@ +post_install() { + if [[ ! -d run/php-fpm ]]; then + usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/php-fpm.conf + fi +} + +post_upgrade() { + post_install +} diff --git a/extra/php/php-fpm.service b/extra/php/php-fpm.service new file mode 100644 index 000000000..e29f7c236 --- /dev/null +++ b/extra/php/php-fpm.service @@ -0,0 +1,13 @@ +[Unit] +Description=FastCGI Process Manager for PHP +After=syslog.target network.target + +[Service] +Type=forking +PIDFile=/run/php-fpm/php-fpm.pid +PrivateTmp=true +ExecStart=/usr/sbin/php-fpm +ExecReload=/bin/kill -USR2 $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/extra/php/php-fpm.tmpfiles b/extra/php/php-fpm.tmpfiles new file mode 100644 index 000000000..801e74f1e --- /dev/null +++ b/extra/php/php-fpm.tmpfiles @@ -0,0 +1 @@ +d /run/php-fpm 755 root root diff --git a/extra/php/rc.d.php-fpm b/extra/php/rc.d.php-fpm index 54bcf4d5b..3b3ec20de 100644 --- a/extra/php/rc.d.php-fpm +++ b/extra/php/rc.d.php-fpm @@ -49,8 +49,6 @@ test_config() { stat_die fi - [ -d /var/run/php-fpm ] || install -d -m755 /var/run/php-fpm - stat_done } @@ -66,7 +64,7 @@ case "$1" in exit 1 fi - wait_for_pid created /var/run/php-fpm/php-fpm.pid + wait_for_pid created /run/php-fpm/php-fpm.pid if [ -n "$try" ] ; then stat_fail @@ -81,14 +79,14 @@ case "$1" in test_config stat_busy 'Gracefully shutting down php-fpm' - if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then + if [ ! -r /run/php-fpm/php-fpm.pid ] ; then stat_fail exit 1 fi - kill -QUIT `cat /var/run/php-fpm/php-fpm.pid` + kill -QUIT `cat /run/php-fpm/php-fpm.pid` - wait_for_pid removed /var/run/php-fpm.pid + wait_for_pid removed /run/php-fpm.pid if [ -n "$try" ] ; then stat_fail @@ -102,14 +100,14 @@ case "$1" in force-quit) stat_busy 'Terminating php-fpm' - if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then + if [ ! -r /run/php-fpm/php-fpm.pid ] ; then stat_fail exit 1 fi - kill -TERM `cat /var/run/php-fpm/php-fpm.pid` + kill -TERM `cat /run/php-fpm/php-fpm.pid` - wait_for_pid removed /var/run/php-fpm/php-fpm.pid + wait_for_pid removed /run/php-fpm/php-fpm.pid if [ -n "$try" ] ; then stat_fail @@ -129,24 +127,12 @@ case "$1" in test_config stat_busy 'Reload service php-fpm' - if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then - stat_fail - exit 1 - fi - - kill -USR2 `cat /var/run/php-fpm/php-fpm.pid` - stat_done - ;; - - logrotate) - stat_busy 'Reopen php-fpm log' - - if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then + if [ ! -r /run/php-fpm/php-fpm.pid ] ; then stat_fail exit 1 fi - kill -USR1 `cat /var/run/php-fpm/php-fpm.pid` + kill -USR2 `cat /run/php-fpm/php-fpm.pid` stat_done ;; |