From c301ec4922e9a0b848b406247615ad66f2a73ec9 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 6 Jul 2012 10:09:53 +0200 Subject: [PATCH] Putting the game/logs directory under version control since it seems some users don't auto-create this at server-start. If you see problems with an already existing game/logs directory upon pulling this commit, remove the old one first (saving away old logs if necessary). --- game/logs/README | 8 ++++++++ game/runner.py | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 game/logs/README diff --git a/game/logs/README b/game/logs/README new file mode 100644 index 000000000..0c62c5425 --- /dev/null +++ b/game/logs/README @@ -0,0 +1,8 @@ +This directory holds log files for the server. + +portal.log - logs from Portal (if run in daemon mode) +server.log - logs from Server (if run in daemon mode) +http_requests.log - http request info (if running webserver/client) + +All log files are rotated to their *.old version when the server is fully +stopped, then restarted again (i.e. not on normal reloads). diff --git a/game/runner.py b/game/runner.py index f962d0a1c..fbf1becb0 100644 --- a/game/runner.py +++ b/game/runner.py @@ -144,6 +144,7 @@ def start_services(server_argv, portal_argv): rc = Popen(server_argv).wait() except Exception, e: print "Server process error: %(e)s" % {'e': e} + return queue.put(("server_stopped", rc)) # this signals the controller that the program finished def portal_waiter(queue): @@ -218,7 +219,7 @@ def main(): options, args = parser.parse_args() if not args or args[0] != 'start': - # this is so as to not be accidentally launched. + # this is so as to avoid runner.py be accidentally launched manually. parser.print_help() sys.exit() @@ -257,12 +258,12 @@ def main(): del server_argv[2] print "\nStarting Evennia Server (output to stdout)." else: + cycle_logfile(SERVER_LOGFILE) print "\nStarting Evennia Server (output to server logfile)." if options.sprof: server_argv.extend(sprof_argv) print "\nRunning Evennia Server under cProfile." - cycle_logfile(SERVER_LOGFILE) # Portal @@ -279,13 +280,13 @@ def main(): set_restart_mode(PORTAL_RESTART, True) print "\nStarting Evennia Portal in non-Daemon mode (output to stdout)." else: + cycle_logfile(PORTAL_LOGFILE) set_restart_mode(PORTAL_RESTART, False) print "\nStarting Evennia Portal in Daemon mode (output to portal logfile)." if options.pprof: portal_argv.extend(pprof_argv) print "\nRunning Evennia Portal under cProfile." - cycle_logfile(PORTAL_LOGFILE) # Windows fixes (Windows don't support pidfiles natively) if os.name == 'nt':