summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2012-03-22 00:39:53 +0000
committerPatrick Lauer <patrick@gentoo.org>2012-03-22 00:39:53 +0000
commit453e67706fe334bdc8825e72dcf7107ab37d813c (patch)
treeb7d7e6ae913f0b0df721f2c1885c1c7277b163c7 /www-servers/gatling/files
parentversion bump (bug #409101) (diff)
downloadgentoo-2-453e67706fe334bdc8825e72dcf7107ab37d813c.tar.gz
gentoo-2-453e67706fe334bdc8825e72dcf7107ab37d813c.tar.bz2
gentoo-2-453e67706fe334bdc8825e72dcf7107ab37d813c.zip
Init script fixes for #409245
(Portage version: 2.2.0_alpha93/cvs/Linux x86_64)
Diffstat (limited to 'www-servers/gatling/files')
-rw-r--r--www-servers/gatling/files/gatling.initd-263
-rw-r--r--www-servers/gatling/files/gentoo-vars.patch20
2 files changed, 63 insertions, 20 deletions
diff --git a/www-servers/gatling/files/gatling.initd-2 b/www-servers/gatling/files/gatling.initd-2
new file mode 100644
index 000000000000..0d5c5fcd4c19
--- /dev/null
+++ b/www-servers/gatling/files/gatling.initd-2
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Gatling high performance web server init script"
+extra_started_commands="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
+ if yesno ${TRANS_PROXY};then TRANS_PROXY=-t;else unset TRANS_PROXY;fi
+}
+
+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/files/gentoo-vars.patch b/www-servers/gatling/files/gentoo-vars.patch
deleted file mode 100644
index 349e9f81f4c9..000000000000
--- a/www-servers/gatling/files/gentoo-vars.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- GNUmakefile.org 2008-05-12 13:59:01.000000000 +0200
-+++ GNUmakefile 2008-05-12 15:04:17.000000000 +0200
-@@ -1,6 +1,6 @@
- #DEBUG=1
- ZLIB=1
--prefix=/opt/diet
-+prefix=/usr
- BINDIR=${prefix}/bin
- MANDIR=${prefix}/man
- man1dir=$(MANDIR)/man1
-@@ -14,8 +14,7 @@
- CROSS=
- #CROSS=i686-mingw32-
- CC=$(CROSS)gcc
--CFLAGS=-pipe -Wall
--LDFLAGS=
-+CFLAGS+=-pipe -Wall -I/usr/include/libowfat
-
- path = $(subst :, ,$(PATH))
- diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))