I needed to run multiple uWSGI instances and defining a number of "profiles" seemed like the best option. This is similar to what databases/slony1v2 uses. For example, in /etc/rc.conf I can have the following settings: uwsgi_enable="YES" uwsgi_profiles=yserver1 server2" uwsgi_server1_flags="..." uwsgi_server2_flags="..." And the rc.d script will now manage two uWSGI instances, each of them can be individually restarted/reloaded/etc. If the uwsgi_profiles is not set, the current variables are used instead. The attached patch contains the following changes: - Don't kill all uwsgi processes with SIGKILL, kill only the master process with SIGINT and let it terminate its children gracefully. - Use SIGHUP for the reload command and add a new command brutalreload (I'd have used forcereload but that's already taken) that sends the SIGTERM signal. http://projects.unbit.it/uwsgi/wiki/uWSGISignals - Add support for running multiple uwsgi instances with different configurations. With no profiles, everything works as before. When you define the uwsgi_profiles variable, it will read the names from there and try to load also variables uwsgi_<profile>_<option>. The script will perform specified actions on all profiles, unless you specify an extra argument in which case it will be performed only on this profile. For example, the following command will only reload the "django" profile: I did the changes mainly for myself, but I thought it could be useful to other people. Fix: Patch attached with submission follows:
Responsible Changed From-To: freebsd-ports-bugs->danger Over to maintainer (via the GNATS Auto Assign Tool)
danger 2011-07-25 16:15:50 UTC FreeBSD ports repository (doc committer) Modified files: www/uwsgi Makefile www/uwsgi/files uwsgi.in Log: - install uwsgidecorators.py as well [1] - improve the rc.d script - allow multiple instances etc (see PR) [2] PR: ports/156723 [2] Submitted by: Luka Lalinsky <lalinsky@gmail.com> [2] Requested by: Attila Nagy <bra@fsn.hu> [1] Revision Changes Path 1.13 +4 -1 ports/www/uwsgi/Makefile 1.3 +59 -5 ports/www/uwsgi/files/uwsgi.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed - committed, thank you very much for your submission!