summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-14 14:08:57 +0100
committerErik Johnston <erik@matrix.org>2014-08-14 14:08:57 +0100
commitcbd5d55222fdc662b7253b9ec75c4ff42cfd92e4 (patch)
tree0ca43d467ef40a594296dbc24807d3ae5b10e485 /synapse/app/homeserver.py
parentMerge branch 'master' of github.com:matrix-org/synapse into sql_refactor (diff)
downloadsynapse-cbd5d55222fdc662b7253b9ec75c4ff42cfd92e4.tar.xz
Change relative db paths to absolute paths in case we daemonize.
Diffstat (limited to '')
-rw-r--r--synapse/app/homeserver.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 82afb04c7d..2fd7e0ae49 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -30,6 +30,7 @@ import argparse
 import logging
 import logging.config
 import sqlite3
+import os
 
 logger = logging.getLogger(__name__)
 
@@ -131,9 +132,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,
     )
 
@@ -141,7 +148,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