Skip to content

Commit

Permalink
replace uwsgi with gunicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
drscream committed Aug 11, 2014
1 parent 1500ab3 commit bf5183c
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 44 deletions.
54 changes: 54 additions & 0 deletions copy/tmp/gunicorn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='network/gunicorn' type='service' version='0'>
<dependency name='net-physical' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/physical'/>
</dependency>
<dependency name='filesystem' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<exec_method name='start' type='method' exec='/opt/local/bin/gunicorn --log-syslog -D -b %{config/listen} -u %{config/user} -g %{config/group} -w %{config/worker} %{config/app}' timeout_seconds='0'/>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='10'/>
<exec_method name='refresh' type='method' exec=':kill -HUP' timeout_seconds='60'/>
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='contract'/>
<propval name='ignore_error' type='astring' value='core,signal'/>
</property_group>
<instance name='default' enabled='false'>
<method_context working_directory='/tmp'>
<method_environment>
<envvar name='PATH' value='/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/bin'/>
<envvar name='PYTHONPATH' value='/opt/local/lib/python2.7/site-packages'/>
</method_environment>
</method_context>
<property_group name='config' type='application'>
<propval name='app' type='astring' value='default_wsgi:application'/>
<propval name='group' type='astring' value='www'/>
<propval name='listen' type='astring' value='127.0.0.1:8000'/>
<propval name='user' type='astring' value='www'/>
<propval name='worker' type='integer' value='1'/>
</property_group>
</instance>
<instance name='kumquat' enabled='true'>
<method_context working_directory='/opt/kumquat'>
<method_environment>
<envvar name='PATH' value='/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/bin'/>
</method_environment>
</method_context>
<property_group name='config' type='application'>
<propval name='app' type='astring' value='kumquat_web.wsgi:application'/>
<propval name='group' type='astring' value='www'/>
<propval name='listen' type='astring' value='127.0.0.1:9000'/>
<propval name='user' type='astring' value='www'/>
<propval name='worker' type='integer' value='1'/>
</property_group>
</instance>
<stability value='Evolving'/>
<template>
<common_name>
<loctext xml:lang='C'>Gunicorn</loctext>
</common_name>
</template>
</service>
</service_bundle>
39 changes: 0 additions & 39 deletions copy/tmp/uwsgi.xml

This file was deleted.

8 changes: 4 additions & 4 deletions customize
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ chown -R www:www /opt/kumquat
echo "* Install missing dependencies via pip"
pip install django django-bootstrap3

# Setup uwsgi and nginx
echo "* Setup uwsgi and nginx"
mkdir -p /opt/local/etc/uwsgi
svccfg import /tmp/uwsgi.xml
# Setup gunicorn
echo "* Setup gunicorn"
mkdir -p /opt/local/etc/gunicorn
svccfg import /tmp/gunicorn.xml

# Remove unused httpd config files
echo "* Remove unused httpd config files"
Expand Down
2 changes: 1 addition & 1 deletion packages
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ quickbackup-percona
apache
proftpd
phpmyadmin
py27-uwsgi
py27-gunicorn
py27-pip
py27-passlib
py27-pymysql
Expand Down

0 comments on commit bf5183c

Please sign in to comment.