Skip to main content

let gunicorn easy install as a service

Project description


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..

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gunicorn-service-0.0.3.zip (5.7 kB view details)

Uploaded Source

File details

Details for the file gunicorn-service-0.0.3.zip.

File metadata

  • Download URL: gunicorn-service-0.0.3.zip
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gunicorn-service-0.0.3.zip
Algorithm Hash digest
SHA256 19fa82f7c51c0528c5313f054c87d4bc6c4e7c3951d44dc4bb38c41690870f18
MD5 c03df73a053cb5e7796c725b02027fd5
BLAKE2b-256 44584bb0e237491921b603418944e111e1f644269bdb44b0aeec8844bb4cbbe4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page