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
This commit is contained in:
Michael Orlitzky
2015-11-23 13:13:21 -05:00
parent 5389c4dc42
commit 334ee76ee6
2 changed files with 16 additions and 6 deletions

View File

@@ -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"

View File

@@ -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 $?
}