diff options
author | Pacho Ramos <pacho@gentoo.org> | 2012-04-02 18:55:13 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2012-04-02 18:55:13 +0000 |
commit | 85bd2b0f6bd2d0bdeae7b0169e45145b9c65490f (patch) | |
tree | a5f66a1caa413541d6b63e2114732bda75db2516 /www-servers/spawn-fcgi | |
parent | version bump (bug #410533) (diff) | |
download | gentoo-2-85bd2b0f6bd2d0bdeae7b0169e45145b9c65490f.tar.gz gentoo-2-85bd2b0f6bd2d0bdeae7b0169e45145b9c65490f.tar.bz2 gentoo-2-85bd2b0f6bd2d0bdeae7b0169e45145b9c65490f.zip |
Don't assume /var/run/spawn-fcgi is always present, bug #400899 by Maxim Kammerer.
(Portage version: 2.1.10.54/cvs/Linux x86_64)
Diffstat (limited to 'www-servers/spawn-fcgi')
-rw-r--r-- | www-servers/spawn-fcgi/ChangeLog | 9 | ||||
-rw-r--r-- | www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1 | 117 | ||||
-rw-r--r-- | www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild | 33 |
3 files changed, 158 insertions, 1 deletions
diff --git a/www-servers/spawn-fcgi/ChangeLog b/www-servers/spawn-fcgi/ChangeLog index da4e311b6a61..056f3948b2d6 100644 --- a/www-servers/spawn-fcgi/ChangeLog +++ b/www-servers/spawn-fcgi/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for www-servers/spawn-fcgi # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/ChangeLog,v 1.30 2012/03/21 11:36:27 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/ChangeLog,v 1.31 2012/04/02 18:55:12 pacho Exp $ + +*spawn-fcgi-1.6.3-r1 (02 Apr 2012) + + 02 Apr 2012; Pacho Ramos <pacho@gentoo.org> +files/spawn-fcgi.initd-r1, + +spawn-fcgi-1.6.3-r1.ebuild: + Don't assume /var/run/spawn-fcgi is always present, bug #400899 by Maxim + Kammerer. 21 Mar 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml: Drop www-server herd as discussed in gentoo-dev ML. diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1 b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1 new file mode 100644 index 000000000000..48328d502c99 --- /dev/null +++ b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1 @@ -0,0 +1,117 @@ +#!/sbin/runscript +# Copyright 1999-2012 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-r1,v 1.1 2012/04/02 18:55:13 pacho Exp $ + +PROGNAME=${SVCNAME#*.} +SPAWNFCGI=/usr/bin/spawn-fcgi +PIDPATH=/var/run/spawn-fcgi +PIDFILE=${PIDPATH}/${PROGNAME} + +depend() { + need net +} + +start() { + local X E OPTIONS i RETVAL FCGI_PROGRAM_EXEC + FCGI_PROGRAM_EXEC=$(echo ${FCGI_PROGRAM} | awk "{print \$1}") + + 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..." + eerror + eerror " ln -s spawn-fcgi /etc/init.d/spawn-fcgi.trac" + eerror " cp /etc/conf.d/spawn-fcgi /etc/conf.d/spawn-fcgi.trac" + eerror " `basename "${EDITOR}"` /etc/conf.d/spawn-fcgi.trac" + eerror + return 1 + fi + + 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}" + return 1 + fi + + if [ -z "${FCGI_PROGRAM}" ]; then + eerror "You need to specify which \$FCGI_PROGRAM" + eerror "you want to start." + eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}" + return 1 + fi + + if [ ! -x "${FCGI_PROGRAM_EXEC}" ]; then + eerror "The file specified as \$FCGI_PROGRAM" + eerror "does not exist or is not executable." + eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}" + return 1 + fi + + if [ -z "${FCGI_ADDRESS}" ]; then + FCGI_ADDRESS=127.0.0.1 + fi + + if [ -z "${FCGI_CHILDREN}" ]; then + FCGI_CHILDREN=1 + fi + + if [ -n "${FCGI_CHROOT}" ]; then + OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}" + fi + + if [ -n "${FCGI_DIR}" ]; then + OPTIONS="${OPTIONS} -d ${FCGI_DIR}" + fi + + if [ -n "${FCGI_USER}" ] && [ "${FCGI_USER}" != "root" ]; then + OPTIONS="${OPTIONS} -u ${FCGI_USER}" + fi + + if [ -n "${FCGI_GROUP}" ] && [ "${FCGI_GROUP}" != "root" ]; then + OPTIONS="${OPTIONS} -g ${FCGI_GROUP}" + fi + + if [ -n "${FCGI_EXTRA_OPTIONS}" ]; then + OPTIONS="${OPTIONS} ${FCGI_EXTRA_OPTIONS}" + fi + + unset E + for i in ${ALLOWED_ENV}; do + local j + eval j=$(echo \$"$i") + [ -n "${j}" ] && E="${E} ${i}=${j}" + done + + ebegin "Starting FastCGI application ${PROGNAME}" + checkpath -q -d -m 700 /var/run/spawn-fcgi + X=0 + while [ $X -lt ${FCGI_CHILDREN} ]; do + X=$(($X+1)) + local P SOCKET_OPTION INET_OPTION + 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))" + + env -i ${E} /sbin/start-stop-daemon --start --pidfile ${P} --exec ${SPAWNFCGI} \ + --name ${FCGI_PROGRAM_EXEC} -- ${SOCKET_OPTION} ${INET_OPTION} \ + -P ${P} ${OPTIONS} -- ${FCGI_PROGRAM} + RETVAL=$? + + # Stop on error. Don't want to spawn a mess! + [ "${RETVAL}" != "0" ] && break + done + eend ${RETVAL} +} + +stop() { + local X RETVAL=0 + + ebegin "Stopping FastCGI application ${PROGNAME}" + for X in ${PIDFILE}-[0-9]*.pid ; do + start-stop-daemon --stop --pidfile ${X} || \ + { RETVAL=$? && break ; } + done + eend ${RETVAL} +} diff --git a/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild new file mode 100644 index 000000000000..215face39a8f --- /dev/null +++ b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild,v 1.1 2012/04/02 18:55:12 pacho Exp $ + +EAPI=4 + +DESCRIPTION="A FCGI spawner for lighttpd and cherokee and other webservers" +HOMEPAGE="http://redmine.lighttpd.net/projects/spawn-fcgi" +SRC_URI="http://www.lighttpd.net/download/${P}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86" +IUSE="ipv6" + +DEPEND="" +RDEPEND="!<=www-servers/lighttpd-1.4.20 + !<=www-servers/cherokee-0.98.1" + +src_configure() { + econf $(use_enable ipv6) +} + +src_install() { + emake DESTDIR="${D}" install + dodoc README NEWS + + newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi + newinitd "${FILESDIR}"/spawn-fcgi.initd-r1 spawn-fcgi + + docinto examples + dodoc doc/run-generic doc/run-php doc/run-rails +} |