diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-14 14:07:14 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-14 14:07:22 +0100 |
commit | e4061383b8bb5b8c3b250a81ea7f0d5b6dd04a0e (patch) | |
tree | d7282555e967f03266dc125616ab265961d2f307 /synapse/app/homeserver.py | |
parent | chmod +x homeserver.py (diff) | |
download | synapse-e4061383b8bb5b8c3b250a81ea7f0d5b6dd04a0e.tar.xz |
Change relative db paths to absolute paths in case we daemonize.
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-x | synapse/app/homeserver.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index fc12e0dba5..3429a29a6b 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -34,6 +34,7 @@ import argparse import logging import logging.config import sqlite3 +import os logger = logging.getLogger(__name__) @@ -234,9 +235,15 @@ def setup(): verbosity = int(args.verbose) if args.verbose else None + # Because if/when we daemonize we change to root dir. + db_name = os.path.abspath(args.db) + log_file = args.log_file + if log_file: + log_file = os.path.abspath(log_file) + setup_logging( verbosity=verbosity, - filename=args.log_file, + filename=log_file, config_path=args.log_config, ) @@ -244,7 +251,7 @@ def setup(): hs = SynapseHomeServer( args.host, - db_name=args.db + db_name=db_name ) # This object doesn't need to be saved because it's set as the handler for |