-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy path560-init-php-fastcgi-rpm.sh
More file actions
61 lines (52 loc) · 1.12 KB
/
560-init-php-fastcgi-rpm.sh
File metadata and controls
61 lines (52 loc) · 1.12 KB
1
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
#!/bin/sh
# php-fastcgi - Use php-fastcgi to run php applications
#
# chkconfig: - 85 15
# description: Use php-fastcgi to run php applications
# processname: php-fastcgi
if [ `grep -c "nginx" /etc/passwd` = "1" ]; then
OWNER=nginx
elif [ `grep -c "www-data" /etc/passwd` = "1" ]; then
OWNER=www-data
elif [ `grep -c "http" /etc/passwd` = "1" ]; then
OWNER=http
else
# Set the OWNER variable below to the user that
# you want to run the php-fastcgi processes as
OWNER=
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/php-fastcgi
NAME=php-fastcgi
DESC=php-fastcgi
test -x $DAEMON || exit 0
# Include php-fastcgi defaults if available
if [ -f /etc/default/php-fastcgi ] ; then
. /etc/default/php-fastcgi
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
sudo -u $OWNER $DAEMON
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
killall -9 php-cgi
echo "$NAME."
;;
restart)
echo -n "Restarting $DESC: "
killall -9 php-cgi
sleep 1
sudo -u $OWNER $DAEMON
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart}" >&2
exit 1
;;
esac
exit 0