From 9ea1de432dedf2130a036fc9eb9d0b8515a24fe8 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 1 Sep 2014 15:51:15 +0100 Subject: Fix homeserver config parsing --- synapse/app/homeserver.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'synapse/app') diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index f56dde846d..124eee8c8d 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -20,7 +20,6 @@ from synapse.server import HomeServer from twisted.internet import reactor from twisted.enterprise import adbapi -from twisted.python.log import PythonLoggingObserver from twisted.web.resource import Resource from twisted.web.static import File from twisted.web.server import Site @@ -34,12 +33,11 @@ from synapse.config.homeserver import HomeServerConfig from daemonize import Daemonize import twisted.manhole.telnet -import argparse import logging -import logging.config import sqlite3 import os import re +import sys logger = logging.getLogger(__name__) @@ -212,28 +210,25 @@ class SynapseHomeServer(HomeServer): logger.info("Synapse now listening on port %d", port) - - - def run(): reactor.run() def setup(): - config = HomeServerConfig.load_config("Synapse Homeserver", sys.argv[1:]) - - config.setup_logging( - verbosity=verbosity, - filename=log_file, - config_path=args.log_config, + config = HomeServerConfig.load_config( + "Synapse Homeserver", + sys.argv[1:], + generate_section="Homeserver" ) + config.setup_logging() + logger.info("Server hostname: %s", config.server_name) if re.search(":[0-9]+$", config.server_name): domain_with_port = config.server_name else: - domain_with_port = "%s:%s" % (args.server_name, config.bind_port) + domain_with_port = "%s:%s" % (config.server_name, config.bind_port) hs = SynapseHomeServer( config.server_name, @@ -260,6 +255,7 @@ def setup(): reactor.listenTCP(config.manhole, f, interface='127.0.0.1') if config.daemonize: + print config.pid_file daemon = Daemonize( app="synapse-homeserver", pid=config.pid_file, -- cgit 1.4.1