diff options
author | 2009-08-18 12:50:28 +0000 | |
---|---|---|
committer | 2009-08-18 12:50:28 +0000 | |
commit | 3fcdc98a98b9bb9c3092422c3c5383dd3340a884 (patch) | |
tree | cbd5919fb175066650cef380e9cc642998e0cd55 /www-servers | |
parent | Move net-libs/xyssl -> polarssl (diff) | |
download | gentoo-2-3fcdc98a98b9bb9c3092422c3c5383dd3340a884.tar.gz gentoo-2-3fcdc98a98b9bb9c3092422c3c5383dd3340a884.tar.bz2 gentoo-2-3fcdc98a98b9bb9c3092422c3c5383dd3340a884.zip |
Adding init script support, fixes #272564. Thanks to Fernando V.
(Portage version: 2.2_rc38/cvs/Linux x86_64)
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/gatling/ChangeLog | 8 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.confd | 49 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.initd | 64 | ||||
-rw-r--r-- | www-servers/gatling/gatling-0.11-r1.ebuild | 55 |
4 files changed, 175 insertions, 1 deletions
diff --git a/www-servers/gatling/ChangeLog b/www-servers/gatling/ChangeLog index f4b50f2a3388..f872d3e513b5 100644 --- a/www-servers/gatling/ChangeLog +++ b/www-servers/gatling/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for www-servers/gatling # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/gatling/ChangeLog,v 1.2 2009/08/15 22:25:20 vostorga Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/gatling/ChangeLog,v 1.3 2009/08/18 12:50:27 patrick Exp $ + +*gatling-0.11-r1 (18 Aug 2009) + + 18 Aug 2009; Patrick Lauer <patrick@gentoo.org> +gatling-0.11-r1.ebuild, + +files/gatling.confd, +files/gatling.initd: + Adding init script support, fixes #272564. Thanks to Fernando V. *gatling-0.11 (15 Aug 2009) diff --git a/www-servers/gatling/files/gatling.confd b/www-servers/gatling/files/gatling.confd new file mode 100644 index 000000000000..afbaecf80780 --- /dev/null +++ b/www-servers/gatling/files/gatling.confd @@ -0,0 +1,49 @@ +# /etc/conf.d/gatling + +# UID to run gatling server on +GATLING_UID="gatling" + +# Bind to IP address +IP="127.0.0.1" + +# Root directory +ROOTDIR="/var/www" + +# Bind to Port +PORT="80" + +# HTTP timeout +HTTP_TIMEOUT="23" + +# Gatling pid file +PID="/var/run/gatling.pid" + +# Virtual domain hosting +VHOST="NO" + +# Directory indexing +DIR_INDEXING="NO" + +# Secure Socket Connections SSL +SSL="NO" + +# Prefetch value (see man page for details) +PREFETCH="2M" + +# FTP access +FTP="YES" + +# FTP timeout +FTP_TIMEOUT="60" + +# FTP User Authorization +FTP_AUTH="YES" + +# FTP file uploads +FTP_UP="NO" + +# Enable ftp file downloads +FTP_FILE_FETCH="YES" + +# Transparent proxy mode +TRANS_PROXY="YES" diff --git a/www-servers/gatling/files/gatling.initd b/www-servers/gatling/files/gatling.initd new file mode 100644 index 000000000000..41f65f1b0175 --- /dev/null +++ b/www-servers/gatling/files/gatling.initd @@ -0,0 +1,64 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/gatling/files/gatling.initd,v 1.1 2009/08/18 12:50:28 patrick Exp $ + +description="Gatling high performance web server init script" +opts="reload" + +depend() { + need net +} + +checkconfig() { + # Verify UID is valid for running process. + if [[ ! $(id ${GATLING_UID} 2>/dev/null) ]]; then + ewarn "User ${GATLING_UID} not found!" + return 1 + fi + + # Set gatling run opts + if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi + if yesno ${SSL};then SSL=-e;else SSL=-E;fi + if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi + if yesno ${FTP}; then FTP=-f;else FTP=-F;fi + if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi + if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi + yesno ${TRANS_PROXY} && TRANS_PROXY=-t +} + +start() { + checkconfig || return 1 + + ebegin "Starting gatling" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \ +--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \ +${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \ +${FTP_AUTH} ${FTP_UPLOADS} + eend $? +} + +stop() { + ebegin "Stopping gatling" + start-stop-daemon --quiet --stop --pidfile ${PID} + eend $? +} + +reload() { + if ! service_started "${SVCNAME}" ; then + eerror "${SVCNAME} isn't running" + return 1 + fi + + checkconfig || return 1 + + ebegin "Sending gatling the HUP signal" + start-stop-daemon --quiet --signal HUP --pidfile ${PID} + + ebegin "Restarting gatling server" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \ +--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \ +${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \ +${FTP_AUTH} ${FTP_UPLOADS} + eend $? +} diff --git a/www-servers/gatling/gatling-0.11-r1.ebuild b/www-servers/gatling/gatling-0.11-r1.ebuild new file mode 100644 index 000000000000..0d405d26def5 --- /dev/null +++ b/www-servers/gatling/gatling-0.11-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/gatling/gatling-0.11-r1.ebuild,v 1.1 2009/08/18 12:50:27 patrick Exp $ + +inherit eutils + +DESCRIPTION="High performance web server" +HOMEPAGE="http://www.fefe.de/gatling/" +SRC_URI="http://dl.fefe.de/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +# We still have compile issues with USE=ssl, so it's commented out for now +#IUSE="ssl" +IUSE="" + +DEPEND="dev-libs/libowfat + dev-libs/dietlibc" + #ssl? ( dev-libs/openssl ) + #" +RDEPEND="" + +src_unpack() { + unpack $A + cd "${S}" + + epatch "${FILESDIR}/gentoo-vars.patch" +} + +src_compile() { + # FIX ME + #if use ssl; then + # emake tlsgatling || die "emake tlsgatling failed" + #fi + emake gatling || die "emake gatling failed" +} + +src_install() { + dobin gatling || die "installing gatling binary failed" + doman gatling.1 || die "installing manpage failed" + # FIX ME + #dobin tlsgatling || die "installing tlsgatling binary failed" + + newconfd "${FILESDIR}/gatling.confd gatling" + newinitd "${FILESDIR}/gatling.initd gatling" + dodoc README.{ftp,http} || die "installing docs failed" +} + +pkg_setup() { + ebegin "Creating gatling user and group" + enewgroup gatling + enewuser ${PN} -1 -1 /var/www/localhost ${PN} +} |