Author: pierre
Date: Sat Mar 29 02:48:53 2014
New Revision: 12906

Log:
Add php-fpm bootscript + typo in README

Added:
   trunk/bootscripts/blfs/init.d/php-fpm   (contents, props changed)
Modified:
   trunk/bootscripts/ChangeLog
   trunk/bootscripts/Makefile
   trunk/bootscripts/README

Modified: trunk/bootscripts/ChangeLog
==============================================================================
--- trunk/bootscripts/ChangeLog Fri Mar 28 16:00:29 2014        (r12905)
+++ trunk/bootscripts/ChangeLog Sat Mar 29 02:48:53 2014        (r12906)
@@ -1,3 +1,6 @@
+2014-03-29 Pierre Labastie <[email protected]>
+   * Added php-fpm bootscript
+
 2014-03-16 Bruce Dubbs <[email protected]>
    * Added haveged bootscript
 

Modified: trunk/bootscripts/Makefile
==============================================================================
--- trunk/bootscripts/Makefile  Fri Mar 28 16:00:29 2014        (r12905)
+++ trunk/bootscripts/Makefile  Sat Mar 29 02:48:53 2014        (r12906)
@@ -66,6 +66,16 @@
        ln -sf  ../init.d/httpd ${EXTDIR}/rc.d/rc5.d/S32httpd
        ln -sf  ../init.d/httpd ${EXTDIR}/rc.d/rc6.d/K28httpd
 
+install-php: create-dirs
+       install -m ${MODE} blfs/init.d/php-fpm     ${EXTDIR}/rc.d/init.d/
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc0.d/K28php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc1.d/K28php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc2.d/K28php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc3.d/S32php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc4.d/S32php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc5.d/S32php-fpm
+       ln -sf  ../init.d/php-fpm ${EXTDIR}/rc.d/rc6.d/K28php-fpm
+
 install-autofs: create-dirs
        install -m $(MODE) blfs/init.d/autofs    $(EXTDIR)/rc.d/init.d/
        install -m $(CONFMODE) blfs/sysconfig/autofs.conf $(EXTDIR)/sysconfig/
@@ -565,6 +575,16 @@
        rm -f ${EXTDIR}/rc.d/rc5.d/S32httpd
        rm -f ${EXTDIR}/rc.d/rc6.d/K28httpd
 
+uninstall-php:
+       rm -f ${EXTDIR}/rc.d/init.d/php-fpm
+       rm -f ${EXTDIR}/rc.d/rc0.d/K28php-fpm
+       rm -f ${EXTDIR}/rc.d/rc1.d/K28php-fpm
+       rm -f ${EXTDIR}/rc.d/rc2.d/K28php-fpm
+       rm -f ${EXTDIR}/rc.d/rc3.d/S32php-fpm
+       rm -f ${EXTDIR}/rc.d/rc4.d/S32php-fpm
+       rm -f ${EXTDIR}/rc.d/rc5.d/S32php-fpm
+       rm -f ${EXTDIR}/rc.d/rc6.d/K28php-fpm
+
 uninstall-autofs:
        rm -f $(EXTDIR)/rc.d/init.d/autofs
        rm -f $(EXTDIR)/rc.d/rcS.d/S52autofs
@@ -969,6 +989,7 @@
        install-alsa \
        install-avahi \
        install-httpd \
+       install-php \
        install-bind \
        install-bluetooth \
        install-cups \
@@ -1012,6 +1033,7 @@
        uninstall-alsa \
        uninstall-avahi \
        uninstall-httpd \
+       uninstall-php \
        uninstall-bind \
        uninstall-bluetooth \
        uninstall-cups \

Modified: trunk/bootscripts/README
==============================================================================
--- trunk/bootscripts/README    Fri Mar 28 16:00:29 2014        (r12905)
+++ trunk/bootscripts/README    Sat Mar 29 02:48:53 2014        (r12906)
@@ -2,7 +2,7 @@
 
 This package contains the bootscripts that are mentioned in
 the BLFS BOOK. The scripts cannot be installed independently
-but needs to be installed in conjunction with a compatible
+but need to be installed in conjunction with a compatible
 lfs-bootscripts package. See the <lfs-bootscripts.version> file
 for compatibility information.
 

Added: trunk/bootscripts/blfs/init.d/php-fpm
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/bootscripts/blfs/init.d/php-fpm       Sat Mar 29 02:48:53 2014        
(r12906)
@@ -0,0 +1,132 @@
+#! /bin/sh
+#######################################################################
+# Begin /etc/init.d/php-fpm
+#
+# Description : Start the PHP fastCGI Proces Manager
+#
+# Author      : P Labastie - [email protected]
+#               from a file shipped with the PHP pacakge
+#
+# Version     : LFS 7.5
+#
+########################################################################
+
+### BEGIN INIT INFO
+# Provides:          php-fpm
+# Required-Start:    $syslog $local_fs $network
+# Should-Start:      $remote_fs
+# Required-Stop:     $network
+# Should-Stop:       $remote_fs
+# Default-Start:     3 4 5
+# Default-Stop:      0 1 2 6
+# Short-Description: starts php-fpm
+# Description:       starts the PHP FastCGI Process Manager daemon
+# X-LFS-Provided-By: BLFS / LFS 7.5
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+#$LastChangedBy$
+#$Date$
+
+prefix=/usr
+exec_prefix=${prefix}
+
+php_fpm_BIN=${exec_prefix}/sbin/php-fpm
+php_fpm_CONF=/etc/php-fpm.conf
+php_fpm_PID=/var/run/php-fpm.pid
+
+
+php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"
+
+
+wait_for_pid () {
+       try=0
+
+       while test $try -lt 35 ; do
+
+               case "$1" in
+                       'created')
+                       if [ -f "$2" ] ; then
+                               try=''
+                               break
+                       fi
+                       ;;
+
+                       'removed')
+                       if [ ! -f "$2" ] ; then
+                               try=''
+                               break
+                       fi
+                       ;;
+               esac
+
+               echo -n .
+               try=`expr $try + 1`
+               sleep 1
+
+       done
+
+}
+
+case "$1" in
+       start)
+               log_info_msg "Starting PHP fastCGI Process Manager..."
+
+               start_daemon $php_fpm_BIN --daemonize $php_opts
+
+               if [ "$?" != 0 ] ; then
+                       log_failure_msg2
+                       exit
+               fi
+
+               wait_for_pid created $php_fpm_PID
+
+               if [ -n "$try" ] ; then
+                       log_failure_msg2
+               else
+                       log_success_msg2
+               fi
+       ;;
+
+       stop)
+               log_info_msg "Stopping PHP fastCGI Process Manager..."
+
+               if [ ! -r $php_fpm_PID ] ; then
+                       log_warning_msg "php-fpm not running?"
+                       exit
+               fi
+
+               killproc -p $php_fpm_PID $php_fpm_BIN -QUIT
+
+               wait_for_pid removed $php_fpm_PID
+
+               if [ -n "$try" ] ; then
+                       log_failure_msg2
+               else
+                       log_success_msg2
+               fi
+       ;;
+
+       status)
+               statusproc $php_fpm_BIN
+       ;;
+
+       restart)
+               $0 stop
+               $0 start
+       ;;
+
+       reload)
+
+               log_info_msg "Reload service php-fpm..."
+               killproc -p $php_fpm_PID $php_fpm_BIN -USR2
+               log_success_msg2
+       ;;
+
+       *)
+               echo "Usage: $0 {start|stop|restart|reload|status}"
+               exit 1
+       ;;
+
+esac
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to