Created
June 30, 2012 22:26
-
-
Save danielrichman/3025813 to your computer and use it in GitHub Desktop.
habitat deployment misc
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
from habitat_calendar.cal import app as application |
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
<uwsgi> | |
<chdir>/home/habitat</chdir> | |
<virtualenv>/home/habitat/ENV</virtualenv> | |
<wsgi-file>/home/habitat/wsgi/calendar.wsgi</wsgi-file> | |
<socket>/var/run/habitat-sockets/calendar</socket> | |
<chmod-socket>666</chmod-socket> | |
<master /> | |
<vacuum /> | |
<no-orphans /> | |
<logto>/home/habitat/logs/calendar.wsgi</logto> | |
<processes>1</processes> | |
<pidfile>/home/habitat/logs/calendar.pid</pidfile> | |
</uwsgi> |
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
@reboot ./launch habitat.parser.Parser ./habitat.yml | |
@reboot ./launch habitat_extensions.transition.spacenearus.SpaceNearUs ./habitat.yml | |
20 * * * * misc/couchdb_runviews.py http://localhost:5984 habitat > /dev/null | |
35 6 * * * /usr/sbin/logrotate -s logs/logrotate.state logs/logrotate.conf |
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
#!/home/habitat/ENV/bin/python | |
import sys | |
import os | |
from habitat.utils.startup import main | |
from habitat.utils.dynamicloader import load | |
# From cusf-standalone-predictor | |
def detach_process(): | |
# Fork | |
if os.fork() > 0: | |
os._exit(0) | |
# Detach | |
os.setsid() | |
null_fd = os.open(os.devnull, os.O_RDWR) | |
for s in [sys.stdin, sys.stdout, sys.stderr]: | |
os.dup2(null_fd, s.fileno()) | |
# Fork | |
if os.fork() > 0: | |
os._exit(0) | |
if len(sys.argv) not in [2, 3]: | |
print "Usage: {0} <daemon name> [<config file>]".format(sys.argv[0]) | |
sys.exit(1) | |
daemon = load(sys.argv.pop(1)) | |
detach_process() | |
main(daemon) |
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
compress | |
missingok | |
rotate 5 | |
weekly | |
/home/habitat/logs/transition.wsgi { | |
postrotate | |
/bin/kill -HUP `cat /home/habitat/logs/transition.pid` | |
endscript | |
} | |
/home/habitat/logs/calendar.wsgi { | |
postrotate | |
/bin/kill -HUP `cat /home/habitat/logs/calendar.pid` | |
endscript | |
} | |
/home/habitat/logs/parser.log /home/habitat/logs/spacenearus.log { | |
} |
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
from habitat_extensions.transition.app import app as application |
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
<uwsgi> | |
<chdir>/home/habitat</chdir> | |
<virtualenv>/home/habitat/ENV</virtualenv> | |
<wsgi-file>/home/habitat/wsgi/transition.wsgi</wsgi-file> | |
<socket>/var/run/habitat-sockets/transition</socket> | |
<chmod-socket>666</chmod-socket> | |
<master /> | |
<vacuum /> | |
<no-orphans /> | |
<logto>/home/habitat/logs/transition.wsgi</logto> | |
<processes>3</processes> | |
<pidfile>/home/habitat/logs/transition.pid</pidfile> | |
</uwsgi> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment