summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'openrc/init.d/php-fpm.in.in')
-rw-r--r--openrc/init.d/php-fpm.in.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/openrc/init.d/php-fpm.in.in b/openrc/init.d/php-fpm.in.in
index 2eaa2c3..3e67e3c 100644
--- a/openrc/init.d/php-fpm.in.in
+++ b/openrc/init.d/php-fpm.in.in
@@ -15,9 +15,15 @@
# slot php7.1 eselected, but also a php-fpm-php7.1 init script. Should
# they manage the same instance? I think so...
#
+
PHP_SLOT="${SVCNAME#php-fpm-}"
if [ "${PHP_SLOT}" = "php-fpm" ] ; then
- PHP_SLOT="$(eselect php show fpm)"
+ # Getting the saved slot allows for clean stops when upgrading to a new slot
+ # This will initially be empty on start and fall through to the default
+ PHP_SLOT="$(service_get_value PHP_SLOT)"
+ if [ -z "${PHP_SLOT}" ]; then
+ PHP_SLOT="$(eselect php show fpm)"
+ fi
fi
PHP_FPM_CONF="@SYSCONFDIR@/php/fpm-${PHP_SLOT}/php-fpm.conf"
@@ -59,6 +65,7 @@ start_pre() {
if [ "${RC_CMD}" != "restart" ] ; then
configtest || return $?
fi
+ service_set_value PHP_SLOT "${PHP_SLOT}"
}
stop_pre() {