summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openrc/init.d/php-fpm.in.in18
1 files changed, 15 insertions, 3 deletions
diff --git a/openrc/init.d/php-fpm.in.in b/openrc/init.d/php-fpm.in.in
index 3e67e3c..79300b6 100644
--- a/openrc/init.d/php-fpm.in.in
+++ b/openrc/init.d/php-fpm.in.in
@@ -17,9 +17,21 @@
#
PHP_SLOT="${SVCNAME#php-fpm-}"
-if [ "${PHP_SLOT}" = "php-fpm" ] ; then
- # 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
+
+# OpenRC caches service dependencies at boot time (in the sysinit
+# runlevel), before any non-boot services are started. If we try to
+# run eselect then, it can fail, producing a scary error message (bug
+# 910589). For now, the error message is harmless, but we may be
+# relying on an implementation detail to make that claim: it's
+# important that no other parts of this script are cached when its
+# dependencies are. Nevertheless -- for now at least -- we can avoid
+# the error message by skipping the call to eselect in the sysinit
+# runlevel, because our (empty) depend() function does not use
+# PHP_SLOT in any way.
+if [ "${PHP_SLOT}" = "php-fpm" ] && [ "${RC_RUNLEVEL}" != "sysinit" ]; then
+ # 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)"