Last active
December 18, 2015 12:19
-
-
Save vadimii/5782309 to your computer and use it in GitHub Desktop.
Run Kule service with upstart and custom python run file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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