Last active
August 29, 2015 14:04
-
-
Save vandorjw/6795d03c3ffe2554738d to your computer and use it in GitHub Desktop.
uWSGI vassal file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Using TCP-Sockets | |
| [uwsgi] | |
| projectname = com_example_www | |
| base = /srv/site/com/example/www | |
| chdir = %(base)/src/%(projectname) | |
| pythonpath = %(base)/src/%(projectname) | |
| virtualenv = %(base)/venv/%(projectname) | |
| disable-logging = true | |
| logto = %(base)/logs/uwsgi.log | |
| env = DJANGO_SETTINGS_MODULE=%(projectname).settings | |
| module = django.core.wsgi:get_wsgi_application() | |
| plugin = python | |
| http-socket = 127.0.0.1:9000 |
Author
Author
FILE: /etc/init.d/uwsgi-emperor
Function that starts the daemon/service with a small edit
-----------
do_start()
{
Return
0 if daemon has been started
1 if daemon was already running
2 if daemon could not be started
if [ "$ENABLED" != yes ]; then
[ "$VERBOSE" != no ] && log_progress_msg "(disabled; see /etc/default/uwsgi-emperor)"
return 2
fi
Assure that /var/run/uwsgi-emperor directory exists
[ -d /run/uwsgi-emperor ] || mkdir -p /run/uwsgi-emperor
Make the socket directory files writable by uwsgi-emperor
chown "www-data" /run/uwsgi-emperor
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --
$DAEMON_ARGS 1> /dev/null 2>&1
|| return 2
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using file-sockets
[uwsgi]
projectname = com_example_www
base = /srv/site/com/example/www
chdir = %(base)/src/%(projectname)
pythonpath = %(base)/src/%(projectname)
virtualenv = %(base)/venv/%(projectname)
plugin = python
gid=www-data
uid=www-data
socket = /run/uwsgi-emperor/%n.sock
chmod-socket = 660
disable-logging = true
logto = /var/log/uwsgi/%n.log
env = DJANGO_SETTINGS_MODULE=%(projectname).settings.local
module = django.core.wsgi:get_wsgi_application()