From 334ee76ee647bfeec1b0e81986eb94ea016358d8 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 23 Nov 2015 13:13:21 -0500 Subject: [PATCH] app-eselect/eselect-php: new revision fixing bugs 508712 and 545652. Both the ebuild and the init script have been revisioned. The ebuild was modified to depend on the apache2 mod_dir module (bug 545652), and a configtest() command was added to the init script (bug 508712). Thanks to Sebastian Pipping and Igor Filakhtov for the reports and fixes. Gentoo-Bug: 508712 Gentoo-bug: 545652 Package-Manager: portage-2.2.20.1 --- ...-0.7.1-r5.ebuild => eselect-php-0.7.1-r6.ebuild} | 9 +++++---- .../files/{php-fpm.init-r2 => php-fpm.init-r3} | 13 +++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) rename app-eselect/eselect-php/{eselect-php-0.7.1-r5.ebuild => eselect-php-0.7.1-r6.ebuild} (79%) rename app-eselect/eselect-php/files/{php-fpm.init-r2 => php-fpm.init-r3} (78%) diff --git a/app-eselect/eselect-php/eselect-php-0.7.1-r5.ebuild b/app-eselect/eselect-php/eselect-php-0.7.1-r6.ebuild similarity index 79% rename from app-eselect/eselect-php/eselect-php-0.7.1-r5.ebuild rename to app-eselect/eselect-php/eselect-php-0.7.1-r6.ebuild index dc2fadc72ba85..cd210279e6b8b 100644 --- a/app-eselect/eselect-php/eselect-php-0.7.1-r5.ebuild +++ b/app-eselect/eselect-php/eselect-php-0.7.1-r6.ebuild @@ -15,15 +15,16 @@ SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" IUSE="fpm apache2" -RDEPEND="app-admin/eselect" +# The "DirectoryIndex" line in 70_mod_php5.conf requires mod_dir. +RDEPEND="app-admin/eselect + apache2? ( www-servers/apache[apache2_modules_dir] )" S="${WORKDIR}" want_apache src_install() { - mv eselect-php-${PV} php.eselect insinto /usr/share/eselect/modules/ - doins php.eselect + newins "eselect-php-${PV}" php.eselect if use apache2 ; then insinto "${APACHE_MODULES_CONFDIR#${EPREFIX}}" @@ -32,7 +33,7 @@ src_install() { fi if use fpm ; then - newinitd "${FILESDIR}/php-fpm.init-r2" "php-fpm" + newinitd "${FILESDIR}/php-fpm.init-r3" "php-fpm" systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf" exeinto /usr/libexec doexe "${FILESDIR}/php-fpm-launcher" diff --git a/app-eselect/eselect-php/files/php-fpm.init-r2 b/app-eselect/eselect-php/files/php-fpm.init-r3 similarity index 78% rename from app-eselect/eselect-php/files/php-fpm.init-r2 rename to app-eselect/eselect-php/files/php-fpm.init-r3 index 8ce81b984bc4d..a1b956ea78e48 100644 --- a/app-eselect/eselect-php/files/php-fpm.init-r2 +++ b/app-eselect/eselect-php/files/php-fpm.init-r3 @@ -1,6 +1,7 @@ #!/sbin/openrc-run extra_started_commands="reload" +extra_commands="configtest" set_phpvars() { PHPSLOT="${SVCNAME#php-fpm-}" @@ -11,13 +12,14 @@ set_phpvars() { fi PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf" + PHP_FPM_BIN="/usr/lib/${PHPSLOT}/bin/php-fpm" } start() { ebegin "Starting PHP FastCGI Process Manager" set_phpvars start-stop-daemon --start --pidfile "${PHP_FPM_PID}" \ - --exec "/usr/lib/${PHPSLOT}/bin/php-fpm" \ + --exec "${PHP_FPM_BIN}" \ -- \ --fpm-config "${PHP_FPM_CONF}" \ --pid "${PHP_FPM_PID}" @@ -37,7 +39,7 @@ stop() { set_phpvars start-stop-daemon --signal QUIT \ --stop \ - --exec "/usr/lib/${PHPSLOT}/bin/php-fpm" \ + --exec "${PHP_FPM_BIN}" \ --pidfile "${PHP_FPM_PID}" eend $? } @@ -48,3 +50,10 @@ reload() { [ -f "${PHP_FPM_PID}" ] && kill -USR2 $(cat "${PHP_FPM_PID}") eend $? } + +configtest() { + ebegin "Testing PHP FastCGI Process Manager configuration" + set_phpvars + "${PHP_FPM_BIN}" --fpm-config "${PHP_FPM_CONF}" --test + eend $? +}