summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2009-04-04 10:40:24 +0000
committerThilo Bangert <bangert@gentoo.org>2009-04-04 10:40:24 +0000
commit264898a35700d12a31ee1e504608797ad85ba6bd (patch)
tree9fadd9715f632751a4bfb5ed506f1889351f808a /www-servers/spawn-fcgi
parentold (diff)
downloadhistorical-264898a35700d12a31ee1e504608797ad85ba6bd.tar.gz
historical-264898a35700d12a31ee1e504608797ad85ba6bd.tar.bz2
historical-264898a35700d12a31ee1e504608797ad85ba6bd.zip
posixify init script - bug #260162 - thanks drizzt
Package-Manager: portage-2.2_rc26/cvs/Linux i686
Diffstat (limited to 'www-servers/spawn-fcgi')
-rw-r--r--www-servers/spawn-fcgi/ChangeLog5
-rw-r--r--www-servers/spawn-fcgi/Manifest4
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.initd33
3 files changed, 24 insertions, 18 deletions
diff --git a/www-servers/spawn-fcgi/ChangeLog b/www-servers/spawn-fcgi/ChangeLog
index 79c631cadb55..3088be05c2dd 100644
--- a/www-servers/spawn-fcgi/ChangeLog
+++ b/www-servers/spawn-fcgi/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for www-servers/spawn-fcgi
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/ChangeLog,v 1.2 2009/04/03 18:18:12 bangert Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/ChangeLog,v 1.3 2009/04/04 10:40:23 bangert Exp $
+
+ 04 Apr 2009; Thilo Bangert <bangert@gentoo.org> files/spawn-fcgi.initd:
+ posixify init script - bug #260162
03 Apr 2009; Thilo Bangert <bangert@gentoo.org> files/spawn-fcgi.confd,
files/spawn-fcgi.initd:
diff --git a/www-servers/spawn-fcgi/Manifest b/www-servers/spawn-fcgi/Manifest
index cbcf5152968f..875e23d1efa3 100644
--- a/www-servers/spawn-fcgi/Manifest
+++ b/www-servers/spawn-fcgi/Manifest
@@ -1,6 +1,6 @@
AUX spawn-fcgi.confd 2211 RMD160 a6f7f778fbe5eab7702a407c9761f537ecb43f83 SHA1 8c8eb892c06aedb3641d7bef692a24200df02f23 SHA256 4a5ce40facaea8bebdc519787111b32a24df82d313079a8e882d599ab4d2b344
-AUX spawn-fcgi.initd 2656 RMD160 307a9c095375716c212157ff93cb49dd6cfae5f8 SHA1 852ee22ff8cfb2e77fda1526ef7d029f465a3249 SHA256 5105430f145f12bacd13db3959eac356e2ccf144722ed2fcde752190d61336aa
+AUX spawn-fcgi.initd 2647 RMD160 ce88b0b7b989bcca49e91e7afd0e5102a18b4929 SHA1 06aa3fc6f1ae328b27a9b4b6c398f71c30846054 SHA256 c92a125c90f8d116198d3b0d53879656d0c4d58c6c59843a0add49f39c01a18d
DIST spawn-fcgi-1.6.1.tar.bz2 71975 RMD160 d906031b3ce40c4a7d682da8acd556f12e8f3fcb SHA1 e18db1367ac1e186972d02e4d9e67a3a34212fc2 SHA256 81301b74d66b8083f23e9c1e39d42fe71995cdf3d06d3beecf3a81a1782f523c
EBUILD spawn-fcgi-1.6.1.ebuild 834 RMD160 68e16ee083830aa035c5051a7ae464d6da4620f7 SHA1 5b94d69e68fb9dbf10d800c380061c643d0bb7a5 SHA256 eca2be8ef509a5532cf9b1b4d90880169b5025784573c6f62f0bbb42d4638d35
-MISC ChangeLog 628 RMD160 01a15eb2696a10ed12496ec083703001c551b02e SHA1 5a700bd50fbd60446e2f662488ba35cad5d7d540 SHA256 9c13634045847e979a6e00cd6659e09aae4fde29415a8de63a9e1723dbc71c8d
+MISC ChangeLog 740 RMD160 68ed4e115c122c25042055156727cfa21ae4e729 SHA1 73d9f94fd33ee6104d0ada03c7ca0e4861c95a8d SHA256 f1c2a4874a9b654a593243dc062f59e49c18556ffe486207634dff5052b342c2
MISC metadata.xml 454 RMD160 6d518892201f5edddc6a83e119384f5c57661d42 SHA1 37c722d45f2473c24620d92f5bc2b31e92f6385c SHA256 dad5c3b31bdf5cffbec7a56402ecc46a9ed1db288f9e27302ca3d53da5b0fe0c
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.initd b/www-servers/spawn-fcgi/files/spawn-fcgi.initd
index ce7e52220758..574ae86cd03e 100644
--- a/www-servers/spawn-fcgi/files/spawn-fcgi.initd
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.initd
@@ -1,9 +1,9 @@
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd,v 1.2 2009/04/03 18:18:13 bangert Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/files/spawn-fcgi.initd,v 1.3 2009/04/04 10:40:24 bangert Exp $
-PROGNAME=${SVCNAME/spawn\-fcgi./}
+PROGNAME=${SVCNAME#*.}
SPAWNFCGI=/usr/bin/spawn-fcgi
PIDPATH=/var/run/spawn-fcgi
PIDFILE=${PIDPATH}/${PROGNAME}
@@ -13,7 +13,7 @@ depend() {
}
start() {
- if [[ "${SVCNAME}" == "spawn-fcgi" ]]; then
+ if [ "${SVCNAME}" = "spawn-fcgi" ]; then
eerror "You are not supposed to run this script directly. Create a symlink"
eerror "for the FastCGI application you want to run as well as a copy of the"
eerror "configuration file and modify it appropriately like so..."
@@ -25,7 +25,7 @@ start() {
return 1
fi
- if [[ ! -z "${FCGI_SOCKET}" ]] && [[ ! -z "${FCGI_PORT}" ]]; then
+ if [ ! -z "${FCGI_SOCKET}" ] && [ ! -z "${FCGI_PORT}" ]; then
eerror "Only one of the two may be defined:"
eerror " FCGI_SOCKET=${FCGI_SOCKET}"
eerror " FCGI_PORT=${FCGI_PORT}"
@@ -34,27 +34,27 @@ start() {
local X E OPTIONS SOCKET_OPTION PORT_OPTION RETVAL
- if [[ -z "${FCGI_ADDRESS}" ]]; then
+ if [ -z "${FCGI_ADDRESS}" ]; then
FCGI_ADDRESS=127.0.0.1
fi
- if [[ -z "${FCGI_CHILDREN}" ]]; then
+ if [ -z "${FCGI_CHILDREN}" ]; then
FCGI_CHILDREN=1
fi
- if [[ -n "${PHP_FCGI_CHILDREN}" ]]; then
+ if [ -n "${PHP_FCGI_CHILDREN}" ]; then
OPTIONS="${OPTIONS} -C ${PHP_FCGI_CHILDREN}"
fi
- if [[ -n "${FCGI_CHROOT}" ]]; then
+ if [ -n "${FCGI_CHROOT}" ]; then
OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}"
fi
- if [[ -n "${FCGI_USER}" ]] && [[ "${FCGI_USER}" != "root" ]]; then
+ if [ -n "${FCGI_USER}" ] && [ "${FCGI_USER}" != "root" ]; then
OPTIONS="${OPTIONS} -u ${FCGI_USER}"
fi
- if [[ -n "${FCGI_GROUP}" ]] && [[ "${FCGI_GROUP}" != "root" ]]; then
+ if [ -n "${FCGI_GROUP}" ] && [ "${FCGI_GROUP}" != "root" ]; then
OPTIONS="${OPTIONS} -g ${FCGI_GROUP}"
fi
@@ -62,22 +62,25 @@ start() {
unset E
for i in ${ALLOWED_ENV}; do
- [[ -n "${!i}" ]] && E="${E} -e ${i}=${!i}"
+ eval j='"$i"'
+ [ -n "${j}" ] && E="${E} -e ${i}=${j}"
done
ebegin "Starting FastCGI application ${PROGNAME}"
- for X in `seq 1 ${FCGI_CHILDREN}`; do
+ X=0
+ while [ $X -lt ${FCGI_CHILDREN} ]; do
+ X=$(($X+1))
local P
P=${PIDFILE}-${X}.pid
- [[ -n "${FCGI_SOCKET}" ]] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}"
- [[ -n "${FCGI_PORT}" ]] && INET_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))"
+ [ -n "${FCGI_SOCKET}" ] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}"
+ [ -n "${FCGI_PORT}" ] && INET_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))"
start-stop-daemon --start --pidfile ${P} ${E} --exec ${SPAWNFCGI} -- \
${SOCKET_OPTION} ${INET_OPTION} -P ${P} ${OPTIONS} -- ${FCGI_PROGRAM}
RETVAL=$?
# Stop on error. Don't want to spawn a mess!
- [[ "${RETVAL}" != "0" ]] && break
+ [ "${RETVAL}" != "0" ] && break
done
eend ${RETVAL}
}