Coder Social home page Coder Social logo

uwsgi-manager's Introduction

Copyright (c) Adam Strauch
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.
   
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#####################################################################

uWSGI Manager

This is small python script for uWSGI instances. It can read your XML configuration and stop/reload/restart/start/what ever with your uWSGI processes. Originaly it was delevoped for Python hosting Rosti.cz, but parts of administration and tools are open now or will be opened soon. Script works only under root privileges.

Using:

	$ mkdir /etc/uwsgi
	$ vim /etc/uwsgi/config.xml
	[copy modified configuration below]
	$ uwsgi-manager.py -l
	$ uwsgi-manager.py -R 1

Config file /etc/uwsgi/config.xml:

	<your_server>
	<uwsgi id="48">
	        <pythonpath>/home/user/django/</pythonpath>
	        <master/>
	        <no-orphans/>
	        <processes>1</processes>
	        <optimize>0</optimize>
	        <home>/home/user/virtualenvs/default</home>
	        <limit-as>128</limit-as>
	        <chmod-socket>660</chmod-socket>
	        <uid>user</uid>
	        <gid>user</gid>
	        <pidfile>/home/user/uwsgi/django.pid</pidfile>
	        <socket>/home/user/uwsgi/django.sock</socket>
	        <wsgi-file>/home/user/django/django.wsgi</wsgi-file>
	        <daemonize>/home/user/uwsgi/django.log</daemonize>
	        <chdir>/home/user/django/</chdir>
	</uwsgi>
	</your_server>

I assume, you use same paths of uwsgi binaries as I:

	* /usr/bin/uwsgi
	* /usr/local/bin/uwsgi25
	* /usr/local/bin/uwsgi27
	* /usr/local/bin/uwsgi31
	* /usr/local/bin/uwsgi32

If you want to use another paths, you have to go into code.

If you are lost, try -h:

	$ ./uwsgi-manager.py -h
	Usage: uwsgi-manager.py [options]

	Options:
	  -h, --help            show this help message and exit
	  -s ID, --start=ID     Start app
	  -S ID, --stop=ID      Stop app (sig 9)
	  -r ID, --reload=ID    Reload app (sig 1)
	  -b ID, --brutal-reload=ID
	                        Brutal reload app (sig 15)
	  -R ID, --restart=ID   Restart app
	  -c ID, --check=ID     Check state of app
	  -a, --start-all       Start all apps
	  -A, --stop-all        Stop all apps
	  -w, --reload-all      Reload all apps
	  -W, --restart-all     Restart all apps
	  -B, --brutal-reload-all
	                        Brutal reload all apps
	  -l, --list            Print state of all apps


Or send me e-mail.

Adam Strauch <[email protected]>

Feel free send some useful patch too :-)

uwsgi-manager's People

Contributors

by-cx avatar rbas avatar

Stargazers

Viktor Matys avatar Pavel Studeník avatar jET avatar Trevor Joynson avatar Bruno Rocha avatar  avatar nordicap avatar  avatar starenka avatar Rushabh Mehta avatar  avatar Eugene MechanisM avatar Igor Gumenyuk avatar Evan Culver avatar Luiz Boaretto avatar Evgeny avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.