Thomas Arnett pointed out two bashisms in our php-fpm launcher, and
provided a new script that works with app-shells/dash. This commit
updates the launcher, and revisions the v0.9.4 ebuild to use it. I
fixed the live ebuild while I was at it.
Gentoo-Bug: 626496
Package-Manager: Portage-2.3.6, Repoman-2.3.1
if use fpm ; then
systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
exeinto /usr/libexec
- newexe "${FILESDIR}/php-fpm-launcher-r1" php-fpm-launcher
+ newexe "${FILESDIR}/php-fpm-launcher-r2" php-fpm-launcher
fi
}
if use fpm ; then
systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
exeinto /usr/libexec
- newexe "${FILESDIR}/php-fpm-launcher-r1" php-fpm-launcher
+ newexe "${FILESDIR}/php-fpm-launcher-r2" php-fpm-launcher
fi
}
+++ /dev/null
-#!/bin/sh
-
-source /lib/gentoo/functions.sh
-
-PHPSLOT="${1}"
-[ -z "${PHPSLOT}" ] && PHPSLOT="$(eselect php show fpm)"
-shift
-
-exec /usr/$(get_libdir)/${PHPSLOT}/bin/php-fpm "${@}"
--- /dev/null
+#!/bin/sh
+
+set -o errexit
+
+. /lib/gentoo/functions.sh
+
+# If there are no arguments, then "shift" will fail (bug 626496).
+if [ $# -eq 0 ]; then
+ PHP_SLOT=$(eselect php show fpm)
+else
+ PHP_SLOT=$1
+ shift
+fi
+
+exec "/usr/$(get_libdir)/${PHP_SLOT}/bin/php-fpm" "${@}"