packages: php/php-fpm.init, php/php-fpm.logrotate - restore

glen glen at pld-linux.org
Thu Nov 26 21:45:54 CET 2009


Author: glen                         Date: Thu Nov 26 20:45:54 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- restore

---- Files affected:
packages/php:
   php-fpm.init (1.7 -> 1.8) , php-fpm.logrotate (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/php/php-fpm.init
diff -u /dev/null packages/php/php-fpm.init:1.8
--- /dev/null	Thu Nov 26 21:45:54 2009
+++ packages/php/php-fpm.init	Thu Nov 26 21:45:49 2009
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# php-fpm	PHP FastCGI Process Manager
+#
+# chkconfig:	345 80 30
+#
+# description:	PHP FastCGI Process Manager
+#
+# processname:	php.fpm
+# config:	/etc/php/fpm.conf
+# pidfile:	/var/run/php/fpm.pid
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+pidfile=/var/run/php/fpm.pid
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/php-fpm ]; then
+		msg_starting "PHP FastCGI Process Manager"
+		daemon --pidfile $pidfile /usr/bin/php.fpm --fpm --fpm-config /etc/php/fpm.conf
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fpm
+	else
+		msg_already_running "PHP FastCGI Process Manager"
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/php-fpm ]; then
+		# Stop daemons.
+		msg_stopping "PHP FastCGI Process Manager"
+		# always gracefully shut down php-fpm
+		/sbin/start-stop-daemon -q --stop -s QUIT --retry QUIT/600/TERM/10 --pidfile $pidfile
+		[ "$?" -eq 0 ] && ok || fail
+		rm -f /var/lock/subsys/php-fpm
+	else
+		msg_not_running "PHP FastCGI Process Manager"
+	fi
+}
+
+reload() {
+	local sig=${1:-HUP}
+	local retnr=${2:-7}
+	if [ -f /var/lock/subsys/php-fpm ]; then
+		msg_reloading "PHP FastCGI Process Manager"
+		killproc --pidfile $pidfile php-fpm -$sig
+		RETVAL=$?
+	else
+		msg_not_running "PHP FastCGI Process Manager"
+		RETVAL=$retnr
+	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/php-fpm ]; then
+		stop
+		start
+	else
+		msg_not_running "PHP FastCGI Process Manager"
+		RETVAL=$1
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop|quit)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  reload|force-reload)
+	reload USR2 7
+	;;
+  flush-logs|logrotate)
+	reload USR1 0
+	;;
+  status)
+	status php-fpm php.fpm
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
+	exit 3
+	;;
+esac
+
+exit $RETVAL

================================================================
Index: packages/php/php-fpm.logrotate
diff -u /dev/null packages/php/php-fpm.logrotate:1.4
--- /dev/null	Thu Nov 26 21:45:54 2009
+++ packages/php/php-fpm.logrotate	Thu Nov 26 21:45:49 2009
@@ -0,0 +1,11 @@
+/var/log/fpm.log
+/var/log/fpm-slow.log
+{
+	notifempty
+	missingok
+	create 600 root root
+	sharedscripts
+	postrotate
+		/sbin/service php-fpm flush-logs > /dev/null
+	endscript
+}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/php-fpm.init?r1=1.7&r2=1.8&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/php-fpm.logrotate?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list