startup gunicorn as service
====
Add python file as service in /etc/init.d/
example: /etc/init.d/myproj
#!/usr/local/bin/python
import sys, os
from gunicorn_service import ServiceSetting, gunicorn_service
#
# work dir setting in /home/project/myproj.py
# and work dir contains wsgi as startup module
#
p = ServiceSetting( config="/home/project/myproj.py"
name=os.path.basename(__file__),
exe="/usr/local/bin/gunicorn" )
gunicorn_service( p )
myproj.py
settings = "Game.settings.local"
bind = "0.0.0.0:55555"
backlog = 512
user = "root"
workers = 1
worker_connections = 2048
daemon = True
max_requests = 40000
chdir = "/hoem/Server/Game"
worker_class = "gevent"
access_logfile = "/var/log/access.log"
error_logfile = "/var/log/error.log"
use service start| stop | stat, and try chkconfig myproj on
use one config to startup standalone or startup as a service..
Fix.. start with pid, and restart..
Release files for gunicorn-service 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gunicorn-service-0.0.3.zip | 5.7 kB | Details |
Release files / gunicorn-service-0.0.3.zip
| Download URL | gunicorn-service-0.0.3.zip |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19fa82f7c51c0528c5313f054c87d4bc6c4e7c3951d44dc4bb38c41690870f18
|
|
BLAKE2b-256 checksum How to use checksums |
44584bb0e237491921b603418944e111e1f644269bdb44b0aeec8844bb4cbbe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |