@@ -150,16 +150,17 @@ def main():
150150 parser .add_argument (
151151 "--no-daemonize" ,
152152 action = "store_false" ,
153+ dest = "daemonize" ,
153154 help = "Run synapse in the foreground for debugging. "
154- "Will work only if the daemonize option is not set in the config."
155+ "Will work only if the daemonize option is not set in the config." ,
155156 )
156157
157158 options = parser .parse_args ()
158159
159160 if options .worker and options .all_processes :
160161 write ('Cannot use "--worker" with "--all-processes"' , stream = sys .stderr )
161162 sys .exit (1 )
162- if options .no_daemonize and options .all_processes :
163+ if not options .daemonize and options .all_processes :
163164 write ('Cannot use "--no-daemonize" with "--all-processes"' , stream = sys .stderr )
164165 sys .exit (1 )
165166
@@ -169,9 +170,8 @@ def main():
169170 write (
170171 "No config file found\n "
171172 "To generate a config file, run '%s -c %s --generate-config"
172- " --server-name=<server name> --report-stats=<yes/no>'\n " % (
173- " " .join (SYNAPSE ), options .configfile ,
174- ),
173+ " --server-name=<server name> --report-stats=<yes/no>'\n "
174+ % (" " .join (SYNAPSE ), options .configfile ),
175175 stream = sys .stderr ,
176176 )
177177 sys .exit (1 )
@@ -289,7 +289,7 @@ def main():
289289 # Check if synapse is already running
290290 if os .path .exists (pidfile ) and pid_running (int (open (pidfile ).read ())):
291291 abort ("synapse.app.homeserver already running" )
292- start (configfile , bool (options .no_daemonize ))
292+ start (configfile , bool (options .daemonize ))
293293
294294 for worker in workers :
295295 env = os .environ .copy ()
0 commit comments