mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-30 04:23:54 +01:00
Don't read from the config file before checking it exists
This commit is contained in:
parent
3c11c9c122
commit
b994fb2b96
1 changed files with 10 additions and 9 deletions
|
@ -27,12 +27,7 @@ CONFIGFILE = "homeserver.yaml"
|
|||
GREEN = "\x1b[1;32m"
|
||||
NORMAL = "\x1b[m"
|
||||
|
||||
CONFIG = yaml.load(open(CONFIGFILE))
|
||||
PIDFILE = CONFIG["pid_file"]
|
||||
|
||||
|
||||
def start():
|
||||
if not os.path.exists(CONFIGFILE):
|
||||
if not os.path.exists(CONFIGFILE):
|
||||
sys.stderr.write(
|
||||
"No config file found\n"
|
||||
"To generate a config file, run '%s -c %s --generate-config"
|
||||
|
@ -41,6 +36,12 @@ def start():
|
|||
)
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
CONFIG = yaml.load(open(CONFIGFILE))
|
||||
PIDFILE = CONFIG["pid_file"]
|
||||
|
||||
|
||||
def start():
|
||||
print "Starting ...",
|
||||
args = SYNAPSE
|
||||
args.extend(["--daemonize", "-c", CONFIGFILE])
|
||||
|
|
Loading…
Reference in a new issue