The php-fpm script features bashisms not compatible if you're using a strictly posix shell like "dash" for booting the system (eg by pointing the sh-symlink to dash). The following lines need to be replaced: --- php-fpm.orig 2010-12-22 23:56:57.948982834 +0100 +++ php-fpm 2010-12-22 23:59:21.339678933 +0100 @@ -2,7 +2,7 @@ PHPSLOT=${SVCNAME#php-fpm-} -if [[ $PHPSLOT == "php-fpm" ]]; then +if [ $PHPSLOT = "php-fpm" ]; then PHPSLOT=$(eselect php show fpm) else PHPSLOT=php${PHPSLOT} @@ -25,12 +25,12 @@ start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec /usr/bin/php-fpm -- -y "${PHP_FPM_CONF}" local i=0 local timeout=5 - while [[ ! -f ${PHP_FPM_PID} ]] && [[ $i -le $timeout ]]; do + while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do sleep 1 i=$(($i + 1)) done - [[ $timeout -gt $i ]] + [ $timeout -gt $i ] eend $? } @@ -42,6 +42,6 @@ reload() { ebegin "Reloading PHP FastCGI Process Manager" - [[ -f ${PHP_FPM_PID} ]] && kill -USR2 $(cat ${PHP_FPM_PID}) + [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID}) eend $? } Reproducible: Always
+1
Please attach a patch (diff -u) so it is easier to apply (without mistakes). Thanks.
Created attachment 258251 [details, diff] Proper posix sh init script + fixes for PHPSLOT, now it should call right binary, not default.
After applying the patch, everything between #!/sbin/runscript and opts="depend start stop reload" should probably be moved to /etc/conf.d/php-fpm.
Ole, can you take a look at this? We could push this with a revbump sometime this/next week.
There is updated version in overlay, php-fpm-r4.init.
Created attachment 260745 [details] new init script.
The bash stuff was actually removed some time ago.