2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#!/bin/bash
# php-fpm startup script for the php-fpm
# php-fpm version:5.5.0-alpha6
# chkconfig: - 85 15
# description: php-fpm is very good
# processname: php-fpm
# pidfile: /var/run/php-fpm.pid
# config: /usr/local/php/etc/php-fpm.conf
php_command= /usr/local/php/sbin/php-fom php_config= /usr/local/php/etc/php-fpm .conf
php_pid= /var/run/php-fpm .pid
RETVAL=0
prog= "php-fpm" #start function
php_fpm_start() {
/usr/local/php/sbin/php-fpm } start(){
if
[ -e $php_pid ] then echo
"php-fpm already start..." exit
1 fi php_fpm_start
} stop(){ if
[ -e $php_pid ] then parent_pid=` cat
$php_pid` all_pid=` ps
-ef | grep
php-fpm | awk
'{if(' $parent_pid ' == $3){print $2}}' `
for
pid in
$all_pid do
kill $pid
done
kill $parent_pid
fi exit
1 } restart(){
stop
start
} # See how we were called.
case
"$1" in start)
start
;; stop)
stop
;; restart)
stop
start
;; status)
status $prog
RETVAL=$?
;; *)
echo $ "Usage: $prog {start|stop|restart|status}"
exit 1 esac exit
$RETVAL |
放到/etc/init.d/下 取名php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig php-fpm on
OK!!!!