diff options
Diffstat (limited to 'www-servers/gatling/files')
-rw-r--r-- | www-servers/gatling/files/gatling-0.12-compile.patch | 20 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling-0.13-compile.patch | 11 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.confd | 49 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.initd | 63 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.initd-2 | 63 | ||||
-rw-r--r-- | www-servers/gatling/files/gatling.initd-3 | 63 |
6 files changed, 269 insertions, 0 deletions
diff --git a/www-servers/gatling/files/gatling-0.12-compile.patch b/www-servers/gatling/files/gatling-0.12-compile.patch new file mode 100644 index 000000000000..db609836332b --- /dev/null +++ b/www-servers/gatling/files/gatling-0.12-compile.patch @@ -0,0 +1,20 @@ +--- GNUmakefile 2012-04-10 04:31:14.505474482 +0200 ++++ GNUmakefile 2012-04-10 04:31:53.821982958 +0200 +@@ -64,7 +64,7 @@ + acc: acc.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) -lowfat + +-CC:=$(DIET) $(CC) ++override CC:=$(DIET) $(CC) + + pthreadbench: pthreadbench.o + $(CC) $< -o $@ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS) -lpthread +@@ -80,7 +80,7 @@ + $(OBJS) https.o gatling.o: gatling.h version.h gatling_features.h + + tlsgatling: gatling.c ssl.o $(HTTPS_OBJS) +- -$(CC) -o $@ gatling.c ssl.o $(HTTPS_OBJS) $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS) ++ $(CC) -o $@ gatling.c ssl.o $(HTTPS_OBJS) $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS) + + gatling: gatling.o $(OBJS) md5lib + $(CC) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LDLIBS) `cat md5lib` diff --git a/www-servers/gatling/files/gatling-0.13-compile.patch b/www-servers/gatling/files/gatling-0.13-compile.patch new file mode 100644 index 000000000000..7b4d44af9c09 --- /dev/null +++ b/www-servers/gatling/files/gatling-0.13-compile.patch @@ -0,0 +1,11 @@ +--- GNUmakefile 2012-04-10 04:31:14.505474482 +0200 ++++ GNUmakefile 2012-04-10 04:31:53.821982958 +0200 +@@ -64,7 +64,7 @@ + acc: acc.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) -lowfat + +-CC:=$(DIET) $(CC) ++override CC:=$(DIET) $(CC) + + pthreadbench: pthreadbench.o + $(CC) $< -o $@ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS) -lpthread 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..fadb1ce9d175 --- /dev/null +++ b/www-servers/gatling/files/gatling.initd @@ -0,0 +1,63 @@ +#!/sbin/openrc-run +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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/files/gatling.initd-2 b/www-servers/gatling/files/gatling.initd-2 new file mode 100644 index 000000000000..77f436009b34 --- /dev/null +++ b/www-servers/gatling/files/gatling.initd-2 @@ -0,0 +1,63 @@ +#!/sbin/openrc-run +# 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/gatling.initd-3 b/www-servers/gatling/files/gatling.initd-3 new file mode 100644 index 000000000000..33c5e5a3095f --- /dev/null +++ b/www-servers/gatling/files/gatling.initd-3 @@ -0,0 +1,63 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 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 $? +} |