summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2009-04-01 10:12:17 +0000
committerThilo Bangert <bangert@gentoo.org>2009-04-01 10:12:17 +0000
commitc7e4a0818298e1cfef46866451ad0d7d5c03d1b8 (patch)
tree82304846d0f3c5c2dde85a78cad5f60b19a94a01 /www-servers/spawn-fcgi
parentAutomated update of use.local.desc (diff)
downloadhistorical-c7e4a0818298e1cfef46866451ad0d7d5c03d1b8.tar.gz
historical-c7e4a0818298e1cfef46866451ad0d7d5c03d1b8.tar.bz2
historical-c7e4a0818298e1cfef46866451ad0d7d5c03d1b8.zip
initial commit - init script adapted from bug #149467 - thanks everybody
Package-Manager: portage-2.2_rc26/cvs/Linux i686
Diffstat (limited to 'www-servers/spawn-fcgi')
-rw-r--r--www-servers/spawn-fcgi/ChangeLog10
-rw-r--r--www-servers/spawn-fcgi/Manifest6
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.confd54
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.initd94
-rw-r--r--www-servers/spawn-fcgi/metadata.xml16
-rw-r--r--www-servers/spawn-fcgi/spawn-fcgi-1.6.1.ebuild29
6 files changed, 209 insertions, 0 deletions
diff --git a/www-servers/spawn-fcgi/ChangeLog b/www-servers/spawn-fcgi/ChangeLog
new file mode 100644
index 000000000000..34eef90bee14
--- /dev/null
+++ b/www-servers/spawn-fcgi/ChangeLog
@@ -0,0 +1,10 @@
+# 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.1 2009/04/01 10:12:17 bangert Exp $
+
+*spawn-fcgi-1.6.1 (01 Apr 2009)
+
+ 01 Apr 2009; Thilo Bangert <bangert@gentoo.org> +files/spawn-fcgi.confd,
+ +files/spawn-fcgi.initd, +metadata.xml, +spawn-fcgi-1.6.1.ebuild:
+ initial commit - init script adapted from bug #149467
+
diff --git a/www-servers/spawn-fcgi/Manifest b/www-servers/spawn-fcgi/Manifest
new file mode 100644
index 000000000000..8916d997dbae
--- /dev/null
+++ b/www-servers/spawn-fcgi/Manifest
@@ -0,0 +1,6 @@
+AUX spawn-fcgi.confd 1971 RMD160 6559f640adbacca42e7b6d508d4b891f978fa8a4 SHA1 22e6322420a2b162de7a9f8f193bf4e16c4b354f SHA256 f65e4051f07b5fd1c8bd5eddb5d1a69eee8fb29d4a29227372c85212bccc06fc
+AUX spawn-fcgi.initd 2654 RMD160 a24a0d6bc008a8131214a00195b1da5261c0309b SHA1 4edc2538e654905187cb4f895504fe601bbb5f84 SHA256 f8858ba2f76d7b093f14a58e7d2356051c410e23c1648ac0af061e5548809394
+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 451 RMD160 6c29a296b21f00659898edbc2784418a92c0fec6 SHA1 e07e4b11b65e45263775431fc5fac7b37cb7a954 SHA256 6c9c623e653f5bf889ad8e7994bed97a84f1e117545a96a070026f294a752e60
+MISC metadata.xml 454 RMD160 6d518892201f5edddc6a83e119384f5c57661d42 SHA1 37c722d45f2473c24620d92f5bc2b31e92f6385c SHA256 dad5c3b31bdf5cffbec7a56402ecc46a9ed1db288f9e27302ca3d53da5b0fe0c
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.confd b/www-servers/spawn-fcgi/files/spawn-fcgi.confd
new file mode 100644
index 000000000000..78f72e2bd0b3
--- /dev/null
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.confd
@@ -0,0 +1,54 @@
+# 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.confd,v 1.1 2009/04/01 10:12:17 bangert Exp $
+
+# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
+
+# One of the following options must be enabled. The filename specified by
+# FCGI_SOCKET will be suffixed with a number for each child process, for
+# example, fcgi.socket-1. The port specified by FCGI_PORT is the port used
+# by the first child process. If this is set to 1234 then subsequent child
+# processes will use 1235, 1236, etc.
+#
+FCGI_SOCKET=
+FCGI_PORT=1234
+
+# When using FCGI_PORT, connections will only be accepted from the following
+# address. The default is 127.0.0.1. Use 0.0.0.0 to bind to all addresses.
+#
+FCGI_ADDRESS=127.0.0.1
+
+# The path to your FastCGI application. These sometimes carry the .fcgi
+# extension but not always. For PHP, you should usually point this to
+# /usr/bin/php-cgi.
+#
+FCGI_PROGRAM=/path/to/application.fcgi
+
+# The number of child processes to spawn. The default is 1. For PHP
+# applications, set this to 1 and use PHP_FCGI_CHILDREN instead.
+#
+FCGI_CHILDREN=1
+
+# If you want to run your application inside a chroot then specify the
+# directory here. Leave this blank otherwise.
+#
+FCGI_CHROOT=
+
+# The user and group to run your application as. If you do not specify these,
+# the application will be run as root:root.
+#
+FCGI_USER=
+FCGI_GROUP=
+
+# If your application requires additional environment variables, you need to
+# allow them here. Only the variables specified here, plus a few others
+# mentioned in the init script are passed to the application.
+#
+ALLOWED_ENV=""
+
+# PHP ONLY :: These two options are specific to PHP. The first is the number
+# of child processes to spawn. The second is the number of requests to be
+# served by a single PHP process before it is restarted.
+#
+PHP_FCGI_CHILDREN=5
+PHP_FCGI_MAX_REQUESTS=500
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.initd b/www-servers/spawn-fcgi/files/spawn-fcgi.initd
new file mode 100644
index 000000000000..999a31e689ba
--- /dev/null
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.initd
@@ -0,0 +1,94 @@
+#!/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.1 2009/04/01 10:12:17 bangert Exp $
+
+PROGNAME=${SVCNAME/spawn\-fcgi./}
+SPAWNFCGI=/usr/bin/spawn-fcgi
+PIDPATH=/var/run/spawn-fcgi
+PIDFILE=${PIDPATH}/${PROGNAME}
+
+depend() {
+ need net
+}
+
+start() {
+ 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 both must be defined:"
+ eerror " FCGI_SOCKET=${FCGI_SOCKET}"
+ eerror " FCGI_PORT=${FCGI_PORT}"
+ return 1
+ fi
+
+ local X E OPTIONS SOCKET_OPTION PORT_OPTION RETVAL
+
+ if [[ -z "${FCGI_ADDRESS}" ]]; then
+ FCGI_ADDRESS=127.0.0.1
+ fi
+
+ if [[ -z "${FCGI_CHILDREN}" ]]; then
+ FCGI_CHILDREN=1
+ fi
+
+ if [[ -n "${PHP_FCGI_CHILDREN}" ]]; then
+ OPTIONS="${OPTIONS} -C ${PHP_FCGI_CHILDREN}"
+ fi
+
+ if [[ -n "${FCGI_CHROOT}" ]]; then
+ OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}"
+ 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
+
+ ALLOWED_ENV="$ALLOWED_ENV USER GROUPS PHP_FCGI_MAX_REQUESTS RAILS_ENV TRAC_ENV_PARENT_DIR TRAC_ENV"
+ unset E
+
+ for i in ${ALLOWED_ENV}; do
+ [[ -n "${!i}" ]] && E="${E} -e ${i}=${!i}"
+ done
+
+ ebegin "Starting FastCGI application ${PROGNAME}"
+ for X in `seq 1 ${FCGI_CHILDREN}`; do
+ local P
+ P=${PIDFILE}-${X}.pid
+ [[ -n "${FCGI_SOCKET}" ]] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}"
+ [[ -n "${FCGI_PORT}" ]] && PORT_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))"
+
+ start-stop-daemon --start --pidfile ${P} ${E} --exec ${SPAWNFCGI} -- \
+ ${SOCKET_OPTION} ${PORT_OPTION} -f ${FCGI_PROGRAM} -P ${P} ${OPTIONS}
+ 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/metadata.xml b/www-servers/spawn-fcgi/metadata.xml
new file mode 100644
index 000000000000..de5ce14a73a4
--- /dev/null
+++ b/www-servers/spawn-fcgi/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>www-servers</herd>
+<longdescription lang="en">
+ spawn-fcgi is used to spawn FastCGI applications
+
+ Features
+ --------
+ - binds to IPv4 and Unix domain sockets
+ - supports privilege separation: chmod/chown socket, drop to uid/gid
+ - supports chroot
+ - supports daemontools supervise
+</longdescription>
+</pkgmetadata>
+
diff --git a/www-servers/spawn-fcgi/spawn-fcgi-1.6.1.ebuild b/www-servers/spawn-fcgi/spawn-fcgi-1.6.1.ebuild
new file mode 100644
index 000000000000..c954fff56f9a
--- /dev/null
+++ b/www-servers/spawn-fcgi/spawn-fcgi-1.6.1.ebuild
@@ -0,0 +1,29 @@
+# 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/spawn-fcgi-1.6.1.ebuild,v 1.1 2009/04/01 10:12:17 bangert Exp $
+
+EAPI="2"
+
+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="~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!<=www-servers/lighttpd-1.4.20
+ !<=www-servers/cherokee-0.98.1"
+
+src_install() {
+ emake DESTDIR="${D}" install || die 'install failed'
+ dodoc README NEWS
+
+ newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi
+ newinitd "${FILESDIR}"/spawn-fcgi.initd spawn-fcgi
+ #pidfile dir
+ dodir /var/run/spawn-fcgi
+ fperms 0700 /var/run/spawn-fcgi
+}