From 305d16d61200362f807fa5d97d415043f2a09315 Mon Sep 17 00:00:00 2001 From: Anant Prakash Date: Wed, 29 Mar 2017 18:17:42 +0530 Subject: add user friendly report of assertion error in synctl.py Signed-off-by: Anant Prakash --- synapse/app/synctl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'synapse/app/synctl.py') diff --git a/synapse/app/synctl.py b/synapse/app/synctl.py index c045588866..81510bc5c1 100755 --- a/synapse/app/synctl.py +++ b/synapse/app/synctl.py @@ -175,7 +175,8 @@ def main(): worker_app = worker_config["worker_app"] worker_pidfile = worker_config["worker_pid_file"] worker_daemonize = worker_config["worker_daemonize"] - assert worker_daemonize # TODO print something more user friendly + assert worker_daemonize, "In config %r: expected '%s' to be True" % ( + worker_configfile, "worker_daemonize") worker_cache_factor = worker_config.get("synctl_cache_factor") workers.append(Worker( worker_app, worker_configfile, worker_pidfile, worker_cache_factor, -- cgit 1.5.1 From 8a1137ceab54b5b2643f1be3995b2977f5cd2c63 Mon Sep 17 00:00:00 2001 From: Kim Brose Date: Thu, 6 Apr 2017 17:10:20 +0200 Subject: fix typo in synctl help --- synapse/app/synctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/app/synctl.py') diff --git a/synapse/app/synctl.py b/synapse/app/synctl.py index c045588866..e84045c7d1 100755 --- a/synapse/app/synctl.py +++ b/synapse/app/synctl.py @@ -98,7 +98,7 @@ def main(): "configfile", nargs="?", default="homeserver.yaml", - help="the homeserver config file, defaults to homserver.yaml", + help="the homeserver config file, defaults to homeserver.yaml", ) parser.add_argument( "-w", "--worker", -- cgit 1.5.1 From c1f52a321d010abd6a5f24da18e871a5e4b9ce12 Mon Sep 17 00:00:00 2001 From: Anant Prakash Date: Thu, 13 Apr 2017 17:59:34 +0530 Subject: synctl.py: Check if synapse is already running --- synapse/app/synctl.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'synapse/app/synctl.py') diff --git a/synapse/app/synctl.py b/synapse/app/synctl.py index 8223734845..3bd7ef7bba 100755 --- a/synapse/app/synctl.py +++ b/synapse/app/synctl.py @@ -234,6 +234,9 @@ def main(): if action == "start" or action == "restart": if start_stop_synapse: + # Check if synapse is already running + if os.path.exists(pidfile) and pid_running(int(open(pidfile).read())): + abort("synapse.app.homeserver already running") start(configfile) for worker in workers: -- cgit 1.5.1