Make sure the daemon starts up in the right directory to access the certs file.

This commit is contained in:
yackob03 2013-10-29 19:59:29 -04:00
parent 9436ae3941
commit 1bbcd91ae0
2 changed files with 4 additions and 2 deletions

View file

@ -209,4 +209,4 @@ def health_check():
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
app.run(host='0.0.0.0', port=5002)
app.run(host='0.0.0.0', port=5002, threaded=True)

View file

@ -5,6 +5,7 @@ import time
import argparse
import digitalocean
import requests
import os
from apscheduler.scheduler import Scheduler
from multiprocessing.pool import ThreadPool
@ -257,7 +258,8 @@ if args.D:
handler = logging.FileHandler(args.log)
handler.setFormatter(formatter)
root_logger.addHandler(handler)
with daemon.DaemonContext(files_preserve=[handler.stream]):
with daemon.DaemonContext(files_preserve=[handler.stream],
working_directory=os.getcwd()):
start_worker()
else: