diff options
author | Maxim Koltsov <maksbotan@gentoo.org> | 2011-05-31 19:49:07 +0000 |
---|---|---|
committer | Maxim Koltsov <maksbotan@gentoo.org> | 2011-05-31 19:49:07 +0000 |
commit | 7517cbd6f7abf1032480f2fecc7d32a9ad177db0 (patch) | |
tree | b207b2cff407a0428478401005b6862e3631e095 /www-servers/uwsgi/files | |
parent | Add new ebuild dev-libs/libbtbb, proxy-maintained by zero_chaos. (diff) | |
download | gentoo-2-7517cbd6f7abf1032480f2fecc7d32a9ad177db0.tar.gz gentoo-2-7517cbd6f7abf1032480f2fecc7d32a9ad177db0.tar.bz2 gentoo-2-7517cbd6f7abf1032480f2fecc7d32a9ad177db0.zip |
Bump www-servers/uwsgi to 0.9.7.2, #340058
(Portage version: 2.1.9.46/cvs/Linux i686)
Diffstat (limited to 'www-servers/uwsgi/files')
-rw-r--r-- | www-servers/uwsgi/files/uwsgi.confd | 47 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi.initd | 101 |
2 files changed, 148 insertions, 0 deletions
diff --git a/www-servers/uwsgi/files/uwsgi.confd b/www-servers/uwsgi/files/uwsgi.confd new file mode 100644 index 000000000000..11152da5dbf7 --- /dev/null +++ b/www-servers/uwsgi/files/uwsgi.confd @@ -0,0 +1,47 @@ +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd,v 1.1 2011/05/31 19:49:07 maksbotan Exp $ + +# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD! + +# Path (or name) of UNIX/TCP socket to bind to +# +UWSGI_SOCKET=127.0.0.1:1234 + +# Enable threads? +# +UWSGI_THREADS=1 + +# The path to your uWSGI application. +# +UWSGI_PROGRAM= + +# The path to your uWSGI xml config file. +# +UWSGI_XML_CONFIG= + +# The number of child processes to spawn. The default is 1. +# +UWSGI_CHILDREN=1 + +# The log file path. If empty logging is disabled +# +UWSGI_LOG_FILE= + +# If you want to run your application inside a chroot then specify the +# directory here. Leave this blank otherwise. +# +UWSGI_CHROOT= + +# If you want to run your application from a specific directiory specify +# it here. Leave this blank otherwise. +# +# UWSGI_DIR= + +# The user and group to run your application as. If you do not specify these, +# the application will be run as root:root. +# +UWSGI_USER= + +# Additional options you might want to pass to uWSGI +# +#UWSGI_EXTRA_OPTIONS= diff --git a/www-servers/uwsgi/files/uwsgi.initd b/www-servers/uwsgi/files/uwsgi.initd new file mode 100644 index 000000000000..3fedecc64f63 --- /dev/null +++ b/www-servers/uwsgi/files/uwsgi.initd @@ -0,0 +1,101 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd,v 1.1 2011/05/31 19:49:07 maksbotan Exp $ + +PROGNAME=${SVCNAME#*.} + +UWSGI_EXEC=/usr/bin/uwsgi +PIDPATH=/var/run/uwsgi +PIDFILE="${PIDPATH}/${PROGNAME}.pid" + +depend() { + need net +} + +start() { + local OPTIONS + + if [ "${SVCNAME}" = "uwsgi" ]; 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 uwsgi /etc/init.d/uwsgi.trac" + eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac" + eerror " `basename "${EDITOR}"` /etc/conf.d/uwsgi.trac" + eerror + return 1 + fi + + if [ -z "${UWSGI_SOCKET}" ]; then + eerror "You need to specify path (or name) of UNIX/TCP socket to bind to" + eerror "in UWSGI_SOCKET" + return 1 + fi + + if [ -z "${UWSGI_PROGRAM}" ] && [ -z "${UWSGI_XML_CONFIG}" ]; then + eerror "You need to specify which \$UWSGI_PROGRAM or \$UWSGI_XML_CONFIG" + eerror "you want to start." + eerror "Please adjust /etc/conf.d/uwsgi.${PROGNAME}" + return 1 + fi + + if [ -n "${UWSGI_PROGRAM}" ] && [ -n "${UWSGI_XML_CONFIG}" ]; then + eerror "Only one of the two may be defined:" + eerror " UWSGI_PROGRAM=${UWSGI_PROGRAM}" + eerror " UWSGI_XML_CONFIG=${UWSGI_XML_CONFIG}" + return 1 + fi + + + OPTIONS="--master --daemonize" + + if [ -n "$UWSGI_LOG_FILE" ]; then + OPTIONS="${OPTIONS} $UWSGI_LOG_FILE" + else + OPTIONS="${OPTIONS} /dev/null --disable-logging" + fi + + if [ "${UWSGI_THREADS}" = "1" ]; then + OPTIONS="${OPTIONS} --enable-threads" + fi + + if [ -n "${UWSGI_SOCKET}" ]; then + OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}" + fi + + if [ -n "${UWSGI_CHILDREN}" ]; then + OPTIONS="${OPTIONS} --processes ${UWSGI_CHILDREN}" + fi + + if [ -n "${UWSGI_CHROOT}" ]; then + OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}" + fi + + [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/" + [ -z "${UWSGI_USER}" ] && UWSGI_USER="root" + + if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then + OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}" + fi + + if [ -n "${UWSGI_PROGRAM}" ]; then + OPTIONS="${OPTIONS} --wsgi-file ${UWSGI_PROGRAM}" + fi + + if [ -n "${UWSGI_XML_CONFIG}" ]; then + OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}" + fi + + ebegin "Starting uWSGI application ${PROGNAME}" + cd "${UWSGI_DIR}" && \ + start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}" + eend $? +} + +stop() { + ebegin "Stopping uWSGI application ${PROGNAME}" + start-stop-daemon --stop --pidfile "${PIDFILE}" --signal 3 + eend $? +} |