From 594106dd68b1acb562f5aa16aa5e8f22fd75d3c7 Mon Sep 17 00:00:00 2001 From: brosner Date: Fri, 11 Jul 2008 14:31:45 -0600 Subject: [PATCH] Added a restart command. --- bosnowsgi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bosnowsgi.py b/bosnowsgi.py index d695199..4c367e8 100755 --- a/bosnowsgi.py +++ b/bosnowsgi.py @@ -191,6 +191,15 @@ def main(): pid = open(server.pidfile, "r").read() print "stopping %s (%s)" % (name, pid) server.stop(pid) + elif command == "restart": + print "restarting %s" % name + # TODO: this should lilkely move into WSGIServerProcess, since it is + # duplicated. + if not server.pidfile: + sys.exit("'%s' does not have a pidfile" % name) + pid = open(server.pidfile, "r").read() + server.stop(pid) + server.start() else: sys.exit("unknown command '%s'" % command)