On Wed, Dec 02, 2015 at 07:22:27PM +0000, Stuart Henderson wrote:
> On 2015-12-02, Christopher Sean Hilton <[email protected]> wrote:
> >
> > Thanks for any information,
>
> I made a start at a port, I was going to use it for something but it
> didn't happen in the end so I left it in openbsd-wip in case anyone
> wants to pick it up. The basics are there (though may need updating)
> and IIRC it did work, it'll want a bit of polish though - rc script,
> probably its own uid/gid, maybe a readme etc.
>
Stuart,
Thank you very much for your port of uwsgi. I got it going on my test
instance without much trouble a couple of weeks ago and I'm putting it
into production. If you are interested, I read the docs on the rc.d
system and came up with this:
#!/bin/sh
#
daemon="/usr/local/sbin/uwsgi"
. /etc/rc.d/rc.subr
pexp="${daemon} .*--master"
rc_reload=NO
rc_cmd $1
## ---------------------
I kept with the emperor/vassals theme and created a directory:
/etc/uwsgi/vassals for configs and ran in master/emperor mode. To run
the script you'll want:
uwsgi_flags="--daemonize --master --emperor /etc/uwsgi/vassals"
in your /etc/rc.conf.local
You'll also probably want to add a user or a few, perhaps one per
uwsgi service instance and create an ini file for each like this.
[uwsgi]
plugins = python
socket = 127.0.0.1:8001
uid = service_user
gid = service_user
chdir = /var/www/htdocs/my_django_site/code
module = my_django_service.wsgi:application
Thanks again for your help. Without it things would have been much
more difficult.
--
Chris
__o "All I was trying to do was get home from work."
_`\<,_ -Rosa Parks
___(*)/_(*)____.___o____..___..o...________ooO..._____________________
Christopher Sean Hilton [chris/at/vindaloo/dot/com]
[demime 1.01d removed an attachment of type application/pgp-signature which had
a name of signature.asc]