summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2015-03-31 16:53:51 +0000
committerUlrich Müller <ulm@gentoo.org>2015-03-31 16:53:51 +0000
commite7062671a863ee35c1c125191ffa9f2e3c4c8a01 (patch)
treeda87a7da63a91704435b682af0588189819598b8 /app-eselect/eselect-php/files
parentMove package from app-admin to app-eselect category. (diff)
downloadgentoo-2-e7062671a863ee35c1c125191ffa9f2e3c4c8a01.tar.gz
gentoo-2-e7062671a863ee35c1c125191ffa9f2e3c4c8a01.tar.bz2
gentoo-2-e7062671a863ee35c1c125191ffa9f2e3c4c8a01.zip
Move package from app-admin to app-eselect category.
(Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 9433907D693FB5B8!)
Diffstat (limited to 'app-eselect/eselect-php/files')
-rw-r--r--app-eselect/eselect-php/files/70_mod_php5.conf-apache214
-rw-r--r--app-eselect/eselect-php/files/php-fpm-launcher7
-rwxr-xr-xapp-eselect/eselect-php/files/php-fpm-r1.init50
-rw-r--r--app-eselect/eselect-php/files/php-fpm.conf1
-rwxr-xr-xapp-eselect/eselect-php/files/php-fpm.init47
-rw-r--r--app-eselect/eselect-php/files/php-fpm_at.service14
6 files changed, 133 insertions, 0 deletions
diff --git a/app-eselect/eselect-php/files/70_mod_php5.conf-apache2 b/app-eselect/eselect-php/files/70_mod_php5.conf-apache2
new file mode 100644
index 000000000000..7ec8739cf837
--- /dev/null
+++ b/app-eselect/eselect-php/files/70_mod_php5.conf-apache2
@@ -0,0 +1,14 @@
+<IfDefine PHP5>
+ # Load the module first
+ <IfModule !mod_php5.c>
+ LoadModule php5_module modules/libphp5.so
+ </IfModule>
+
+ # Set it to handle the files
+ <IfModule mod_mime.c>
+ AddHandler application/x-httpd-php .php .php5 .phtml
+ AddHandler application/x-httpd-php-source .phps
+ </IfModule>
+
+ DirectoryIndex index.php index.phtml
+</IfDefine>
diff --git a/app-eselect/eselect-php/files/php-fpm-launcher b/app-eselect/eselect-php/files/php-fpm-launcher
new file mode 100644
index 000000000000..7a1c1c9f918b
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm-launcher
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+PHPSLOT="${1}"
+[ -z "${PHPSLOT}" ] && PHPSLOT="$(eselect php show fpm)"
+shift
+
+exec /usr/lib/${PHPSLOT}/bin/php-fpm "${@}"
diff --git a/app-eselect/eselect-php/files/php-fpm-r1.init b/app-eselect/eselect-php/files/php-fpm-r1.init
new file mode 100755
index 000000000000..6cc26acc3c36
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm-r1.init
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+set_phpvars() {
+ PHPSLOT=${SVCNAME#php-fpm-}
+ PHP_FPM_PID="/run/php-fpm-${PHPSLOT}.pid"
+ if [ ${PHPSLOT} = 'php-fpm' ] ; then
+ PHPSLOT="$(eselect php show fpm)"
+ PHP_FPM_PID="/run/php-fpm.pid"
+ fi
+
+ PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
+}
+
+extra_commands="depend"
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use apache2 lighttpd nginx
+}
+
+start() {
+ ebegin "Starting PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
+ /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
+ local i=0
+ local timeout=5
+ while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
+ sleep 1
+ i=$(($i + 1))
+ done
+
+ [ $timeout -gt $i ]
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PHP FastCGI Process Manager"
+ set_phpvars
+ [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})
+ eend $?
+}
diff --git a/app-eselect/eselect-php/files/php-fpm.conf b/app-eselect/eselect-php/files/php-fpm.conf
new file mode 100644
index 000000000000..801e74f1e620
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm.conf
@@ -0,0 +1 @@
+d /run/php-fpm 755 root root
diff --git a/app-eselect/eselect-php/files/php-fpm.init b/app-eselect/eselect-php/files/php-fpm.init
new file mode 100755
index 000000000000..a186d83478c5
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm.init
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+
+set_phpvars() {
+ PHPSLOT=${SVCNAME#php-fpm-}
+ [ ${PHPSLOT} = 'php-fpm' ] && PHPSLOT="$(eselect php show fpm)"
+
+ PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
+ PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid"
+}
+
+extra_commands="depend"
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use apache2 lighttpd nginx
+}
+
+start() {
+ ebegin "Starting PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
+ /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
+ local i=0
+ local timeout=5
+ while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
+ sleep 1
+ i=$(($i + 1))
+ done
+
+ [ $timeout -gt $i ]
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PHP FastCGI Process Manager"
+ set_phpvars
+ [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})
+ eend $?
+}
diff --git a/app-eselect/eselect-php/files/php-fpm_at.service b/app-eselect/eselect-php/files/php-fpm_at.service
new file mode 100644
index 000000000000..152c1abe0438
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm_at.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=The PHP FastCGI Process Manager
+After=network.target
+
+[Service]
+Type=notify
+PIDFile=/run/php-fpm/php-fpm-%I.pid
+ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize
+ExecReload=/bin/kill -USR2 $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
+