1 |
bangert 09/04/09 18:56:04 |
2 |
|
3 |
Modified: spawn-fcgi.initd spawn-fcgi.confd |
4 |
Log: |
5 |
keepdir - fix init script for old baselayout (bug #265454)- some minor cleanups |
6 |
(Portage version: 2.2_rc26/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.5 www-servers/spawn-fcgi/files/spawn-fcgi.initd |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd?rev=1.5&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd?rev=1.5&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd?r1=1.4&r2=1.5 |
14 |
|
15 |
Index: spawn-fcgi.initd |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd,v |
18 |
retrieving revision 1.4 |
19 |
retrieving revision 1.5 |
20 |
diff -u -r1.4 -r1.5 |
21 |
--- spawn-fcgi.initd 7 Apr 2009 08:39:00 -0000 1.4 |
22 |
+++ spawn-fcgi.initd 9 Apr 2009 18:56:04 -0000 1.5 |
23 |
@@ -1,7 +1,7 @@ |
24 |
#!/sbin/runscript |
25 |
# Copyright 1999-2009 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd,v 1.4 2009/04/07 08:39:00 bangert Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd,v 1.5 2009/04/09 18:56:04 bangert Exp $ |
29 |
|
30 |
PROGNAME=${SVCNAME#*.} |
31 |
SPAWNFCGI=/usr/bin/spawn-fcgi |
32 |
@@ -32,7 +32,14 @@ |
33 |
return 1 |
34 |
fi |
35 |
|
36 |
- local X E OPTIONS SOCKET_OPTION PORT_OPTION RETVAL |
37 |
+ if [ -z "${FCGI_PROGRAM}" ]; then |
38 |
+ eerror "You need to specify which FCGI program you want" |
39 |
+ eerror "spawn-fcgi to start." |
40 |
+ eerror "Look at /etc/conf.d/spawn-fcgi.${PROGNAME}" |
41 |
+ return 1 |
42 |
+ fi |
43 |
+ |
44 |
+ local X E OPTIONS i RETVAL |
45 |
|
46 |
if [ -z "${FCGI_ADDRESS}" ]; then |
47 |
FCGI_ADDRESS=127.0.0.1 |
48 |
@@ -42,10 +49,6 @@ |
49 |
FCGI_CHILDREN=1 |
50 |
fi |
51 |
|
52 |
- if [ -n "${PHP_FCGI_CHILDREN}" ]; then |
53 |
- OPTIONS="${OPTIONS} -C ${PHP_FCGI_CHILDREN}" |
54 |
- fi |
55 |
- |
56 |
if [ -n "${FCGI_CHROOT}" ]; then |
57 |
OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}" |
58 |
fi |
59 |
@@ -58,27 +61,23 @@ |
60 |
OPTIONS="${OPTIONS} -g ${FCGI_GROUP}" |
61 |
fi |
62 |
|
63 |
- ALLOWED_ENV="$ALLOWED_ENV USER GROUPS PHP_FCGI_MAX_REQUESTS RAILS_ENV TRAC_ENV_PARENT_DIR TRAC_ENV" |
64 |
unset E |
65 |
- |
66 |
for i in ${ALLOWED_ENV}; do |
67 |
- eval j='"$i"' |
68 |
+ local j |
69 |
+ eval j=$(echo \$"$i") |
70 |
[ -n "${j}" ] && E="${E} -e ${i}=${j}" |
71 |
done |
72 |
|
73 |
- #make sure pidfile dir exists |
74 |
- install -d "${PIDPATH}" -m 0700 -o root |
75 |
- |
76 |
ebegin "Starting FastCGI application ${PROGNAME}" |
77 |
X=0 |
78 |
while [ $X -lt ${FCGI_CHILDREN} ]; do |
79 |
X=$(($X+1)) |
80 |
- local P |
81 |
+ local P SOCKET_OPTION INET_OPTION |
82 |
P=${PIDFILE}-${X}.pid |
83 |
[ -n "${FCGI_SOCKET}" ] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}" |
84 |
[ -n "${FCGI_PORT}" ] && INET_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))" |
85 |
|
86 |
- start-stop-daemon --start --pidfile ${P} ${E} --exec ${SPAWNFCGI} -- \ |
87 |
+ start-stop-daemon --start --pidfile ${P} ${E} --exec ${SPAWNFCGI} --name ${FCGI_PROGRAM} -- \ |
88 |
${SOCKET_OPTION} ${INET_OPTION} -P ${P} ${OPTIONS} -- ${FCGI_PROGRAM} |
89 |
RETVAL=$? |
90 |
|
91 |
|
92 |
|
93 |
|
94 |
1.3 www-servers/spawn-fcgi/files/spawn-fcgi.confd |
95 |
|
96 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd?rev=1.3&view=markup |
97 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd?rev=1.3&content-type=text/plain |
98 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd?r1=1.2&r2=1.3 |
99 |
|
100 |
Index: spawn-fcgi.confd |
101 |
=================================================================== |
102 |
RCS file: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd,v |
103 |
retrieving revision 1.2 |
104 |
retrieving revision 1.3 |
105 |
diff -u -r1.2 -r1.3 |
106 |
--- spawn-fcgi.confd 3 Apr 2009 18:18:13 -0000 1.2 |
107 |
+++ spawn-fcgi.confd 9 Apr 2009 18:56:04 -0000 1.3 |
108 |
@@ -1,6 +1,6 @@ |
109 |
# Copyright 1999-2009 Gentoo Foundation |
110 |
# Distributed under the terms of the GNU General Public License v2 |
111 |
-# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd,v 1.2 2009/04/03 18:18:13 bangert Exp $ |
112 |
+# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.confd,v 1.3 2009/04/09 18:56:04 bangert Exp $ |
113 |
|
114 |
# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD! |
115 |
|
116 |
@@ -31,10 +31,10 @@ |
117 |
# extension but not always. For PHP, you should usually point this to |
118 |
# /usr/bin/php-cgi. |
119 |
# |
120 |
-FCGI_PROGRAM=/path/to/application.fcgi |
121 |
+#FCGI_PROGRAM=/usr/bin/php-cgi |
122 |
+FCGI_PROGRAM= |
123 |
|
124 |
-# The number of child processes to spawn. The default is 1. For PHP |
125 |
-# applications, set this to 1 and use PHP_FCGI_CHILDREN instead. |
126 |
+# The number of child processes to spawn. The default is 1. |
127 |
# |
128 |
FCGI_CHILDREN=1 |
129 |
|
130 |
@@ -49,11 +49,10 @@ |
131 |
FCGI_USER= |
132 |
FCGI_GROUP= |
133 |
|
134 |
-# If your application requires additional environment variables, you need to |
135 |
-# allow them here. Only the variables specified here, plus a few others |
136 |
-# mentioned in the init script are passed to the application. |
137 |
+# If your application requires additional environment variables, you may |
138 |
+# specify them here. See PHP example below. |
139 |
# |
140 |
-ALLOWED_ENV="" |
141 |
+ALLOWED_ENV= |
142 |
|
143 |
# PHP ONLY :: These two options are specific to PHP. The first is the number |
144 |
# of child processes to spawn. The second is the number of requests to be |
145 |
@@ -61,3 +60,6 @@ |
146 |
# |
147 |
#PHP_FCGI_CHILDREN=5 |
148 |
#PHP_FCGI_MAX_REQUESTS=500 |
149 |
+# |
150 |
+# For this to work you would set |
151 |
+# ALLOWED_ENV="PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS" |