Gentoo Archives: gentoo-commits

From: "Maxim Koltsov (maksbotan)" <maksbotan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/uwsgi/files: uwsgi.initd uwsgi.confd
Date: Tue, 31 May 2011 19:49:19
Message-Id: 20110531194907.37DC620057@flycatcher.gentoo.org
1 maksbotan 11/05/31 19:49:07
2
3 Added: uwsgi.initd uwsgi.confd
4 Log:
5 Bump www-servers/uwsgi to 0.9.7.2, #340058
6
7 (Portage version: 2.1.9.46/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 www-servers/uwsgi/files/uwsgi.initd
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd?rev=1.1&content-type=text/plain
14
15 Index: uwsgi.initd
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2011 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd,v 1.1 2011/05/31 19:49:07 maksbotan Exp $
21
22 PROGNAME=${SVCNAME#*.}
23
24 UWSGI_EXEC=/usr/bin/uwsgi
25 PIDPATH=/var/run/uwsgi
26 PIDFILE="${PIDPATH}/${PROGNAME}.pid"
27
28 depend() {
29 need net
30 }
31
32 start() {
33 local OPTIONS
34
35 if [ "${SVCNAME}" = "uwsgi" ]; then
36 eerror "You are not supposed to run this script directly. Create a symlink"
37 eerror "for the FastCGI application you want to run as well as a copy of the"
38 eerror "configuration file and modify it appropriately like so..."
39 eerror
40 eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
41 eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
42 eerror " `basename "${EDITOR}"` /etc/conf.d/uwsgi.trac"
43 eerror
44 return 1
45 fi
46
47 if [ -z "${UWSGI_SOCKET}" ]; then
48 eerror "You need to specify path (or name) of UNIX/TCP socket to bind to"
49 eerror "in UWSGI_SOCKET"
50 return 1
51 fi
52
53 if [ -z "${UWSGI_PROGRAM}" ] && [ -z "${UWSGI_XML_CONFIG}" ]; then
54 eerror "You need to specify which \$UWSGI_PROGRAM or \$UWSGI_XML_CONFIG"
55 eerror "you want to start."
56 eerror "Please adjust /etc/conf.d/uwsgi.${PROGNAME}"
57 return 1
58 fi
59
60 if [ -n "${UWSGI_PROGRAM}" ] && [ -n "${UWSGI_XML_CONFIG}" ]; then
61 eerror "Only one of the two may be defined:"
62 eerror " UWSGI_PROGRAM=${UWSGI_PROGRAM}"
63 eerror " UWSGI_XML_CONFIG=${UWSGI_XML_CONFIG}"
64 return 1
65 fi
66
67
68 OPTIONS="--master --daemonize"
69
70 if [ -n "$UWSGI_LOG_FILE" ]; then
71 OPTIONS="${OPTIONS} $UWSGI_LOG_FILE"
72 else
73 OPTIONS="${OPTIONS} /dev/null --disable-logging"
74 fi
75
76 if [ "${UWSGI_THREADS}" = "1" ]; then
77 OPTIONS="${OPTIONS} --enable-threads"
78 fi
79
80 if [ -n "${UWSGI_SOCKET}" ]; then
81 OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
82 fi
83
84 if [ -n "${UWSGI_CHILDREN}" ]; then
85 OPTIONS="${OPTIONS} --processes ${UWSGI_CHILDREN}"
86 fi
87
88 if [ -n "${UWSGI_CHROOT}" ]; then
89 OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
90 fi
91
92 [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
93 [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
94
95 if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
96 OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
97 fi
98
99 if [ -n "${UWSGI_PROGRAM}" ]; then
100 OPTIONS="${OPTIONS} --wsgi-file ${UWSGI_PROGRAM}"
101 fi
102
103 if [ -n "${UWSGI_XML_CONFIG}" ]; then
104 OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
105 fi
106
107 ebegin "Starting uWSGI application ${PROGNAME}"
108 cd "${UWSGI_DIR}" && \
109 start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
110 eend $?
111 }
112
113 stop() {
114 ebegin "Stopping uWSGI application ${PROGNAME}"
115 start-stop-daemon --stop --pidfile "${PIDFILE}" --signal 3
116 eend $?
117 }
118
119
120
121 1.1 www-servers/uwsgi/files/uwsgi.confd
122
123 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd?rev=1.1&view=markup
124 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd?rev=1.1&content-type=text/plain
125
126 Index: uwsgi.confd
127 ===================================================================
128 # Distributed under the terms of the GNU General Public License v2
129 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd,v 1.1 2011/05/31 19:49:07 maksbotan Exp $
130
131 # DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
132
133 # Path (or name) of UNIX/TCP socket to bind to
134 #
135 UWSGI_SOCKET=127.0.0.1:1234
136
137 # Enable threads?
138 #
139 UWSGI_THREADS=1
140
141 # The path to your uWSGI application.
142 #
143 UWSGI_PROGRAM=
144
145 # The path to your uWSGI xml config file.
146 #
147 UWSGI_XML_CONFIG=
148
149 # The number of child processes to spawn. The default is 1.
150 #
151 UWSGI_CHILDREN=1
152
153 # The log file path. If empty logging is disabled
154 #
155 UWSGI_LOG_FILE=
156
157 # If you want to run your application inside a chroot then specify the
158 # directory here. Leave this blank otherwise.
159 #
160 UWSGI_CHROOT=
161
162 # If you want to run your application from a specific directiory specify
163 # it here. Leave this blank otherwise.
164 #
165 # UWSGI_DIR=
166
167 # The user and group to run your application as. If you do not specify these,
168 # the application will be run as root:root.
169 #
170 UWSGI_USER=
171
172 # Additional options you might want to pass to uWSGI
173 #
174 #UWSGI_EXTRA_OPTIONS=