Skip to content

Instantly share code, notes, and snippets.

@vadimii
Last active December 18, 2015 12:19
Show Gist options
  • Save vadimii/5782309 to your computer and use it in GitHub Desktop.
Save vadimii/5782309 to your computer and use it in GitHub Desktop.
Run Kule service with upstart and custom python run file
# upstart config /etc/init/kule.conf
description "Kule service for some-ui project"
author "Someone <[email protected]>"
start on runlevel [2345]
stop on runlevel [06]
respawn
exec python /home/admin/services/somekule.py
# kule start script
# /home/admin/services/somekule.py
from kule import Kule
DATABASE = 'someui'
COLLECTIONS = [
'therapy',
'endocrinology',
'oncology',
'psychoneurology',
'urology',
'psychophysiology',
'psychiatry',
'otolaryngology',
'ophthalmology',
'nevropatalogiya',
'cardiology',
'gynecology',
'surgery',
'stomatology',
'dermatovenereology',
'rheumatology'
]
KULE_SERVICE_HOST = 'kule.example.com'
KULE_SERVICE_PORT = 80222
class MiasKule(Kule):
pass
kulesrv = MiasKule(database=DATABASE,
collections=COLLECTIONS)
kulesrv.run(host=KULE_SERVICE_HOST,
port=KULE_SERVICE_PORT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment