]> git.pld-linux.org Git - packages/php.git/blame - php-fpm.init
- oudated with fpm-0.5.10
[packages/php.git] / php-fpm.init
CommitLineData
ae1427a4
ER
1#!/bin/sh
2#
3# php-fpm PHP FastCGI Process Manager
4#
5# chkconfig: 345 80 30
6#
7# description: PHP FastCGI Process Manager
8#
9# processname: php.fpm
10# config: /etc/php/fpm.conf
11# pidfile: /var/run/php/fpm.pid
12#
13# $Id$
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18# Get network config
19. /etc/sysconfig/network
3aa45803 20
2a6ec4b9 21pidfile=/var/run/php/fpm.pid
3aa45803 22
ae1427a4 23start() {
2a6ec4b9
ER
24 # Check if the service is already running?
25 if [ ! -f /var/lock/subsys/php-fpm ]; then
26 msg_starting "PHP FastCGI Process Manager"
27 daemon /usr/bin/php.fpm --fpm --fpm-config /etc/php/fpm.conf
28 RETVAL=$?
29 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fpm
ae1427a4 30 else
2a6ec4b9 31 msg_already_running "PHP FastCGI Process Manager"
ae1427a4
ER
32 fi
33}
3aa45803 34
ae1427a4 35stop() {
2a6ec4b9
ER
36 if [ -f /var/lock/subsys/php-fpm ]; then
37 # Stop daemons.
38 msg_stopping "PHP FastCGI Process Manager"
04aad4ba 39 # always gracefully shut down php-fpm
2a6ec4b9
ER
40 killproc --pidfile $pidfile php-fpm -QUIT
41 rm -f /var/lock/subsys/php-fpm
ae1427a4 42 else
2a6ec4b9 43 msg_not_running "PHP FastCGI Process Manager"
ae1427a4
ER
44 fi
45}
3aa45803 46
ae1427a4 47reload() {
2a6ec4b9
ER
48 local sig=${1:-HUP}
49 local retnr=${2:-7}
50 if [ -f /var/lock/subsys/php-fpm ]; then
51 msg_reloading "PHP FastCGI Process Manager"
52 killproc --pidfile $pidfile php-fpm -$sig
53 RETVAL=$?
54 else
55 msg_not_running "PHP FastCGI Process Manager"
56 RETVAL=$retnr
ae1427a4 57 fi
ae1427a4 58}
3aa45803 59
ae1427a4
ER
60condrestart() {
61 if [ -f /var/lock/subsys/php-fpm ]; then
62 stop
63 start
64 else
2a6ec4b9 65 msg_not_running "PHP FastCGI Process Manager"
ae1427a4
ER
66 RETVAL=$1
67 fi
68}
3aa45803 69
ae1427a4
ER
70RETVAL=0
71# See how we were called.
72case "$1" in
73 start)
74 start
3aa45803 75 ;;
04aad4ba 76 stop|quit)
ae1427a4
ER
77 stop
78 ;;
79 restart)
80 stop
81 start
82 ;;
83 try-restart)
84 condrestart 0
85 ;;
86 reload|force-reload)
2a6ec4b9 87 reload USR2 7
ae1427a4 88 ;;
ae1427a4 89 flush-logs|logrotate)
2a6ec4b9 90 reload USR1 0
ae1427a4
ER
91 ;;
92 status)
93 status php-fpm php.fpm
94 RETVAL=$?
95 ;;
96 *)
97 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
98 exit 3
3aa45803 99 ;;
3aa45803 100esac
ae1427a4
ER
101
102exit $RETVAL
This page took 0.03672 seconds and 4 git commands to generate.