create disks as hda instead of xvda so as to avoid breaking qemu-dm
[invirt/packages/invirt-web.git] / code / invirt.fcgi
index 607a4ea..ded6b68 100755 (executable)
@@ -14,14 +14,15 @@ def usage():
     argv0_dir = os.path.dirname(sys.argv[0])
     print >>sys.stderr, """%s <unauth|auth> [config]
 
     argv0_dir = os.path.dirname(sys.argv[0])
     print >>sys.stderr, """%s <unauth|auth> [config]
 
+Or via the provided wrapper scripts:
+%s/auth.fcgi [config]
+%s/unauth.fcgi [config]
+
 Run server as FastCGI, with CherryPy config from "main.conf".
 With `config`, run standalone with CherryPy config from `config`.
 
 Run server as FastCGI, with CherryPy config from "main.conf".
 With `config`, run standalone with CherryPy config from `config`.
 
-Serve the authenticated or unauthenticated site according to
-the first argument.
-
-Helper scripts "auth.fcgi" and "unauth.fcgi" are provided to
-facilitate running the server with no arguments.
+Serve the authenticated site with 'auth' or under 'auth.fcgi',
+and the unauthenticated site with 'unauth' or under 'unauth.fcgi'.
 """ % (sys.argv[0], argv0_dir, argv0_dir)
     sys.exit(2)
 
 """ % (sys.argv[0], argv0_dir, argv0_dir)
     sys.exit(2)
 
@@ -41,6 +42,7 @@ if __name__ == "__main__":
     app_config = {
         '/': {
             'tools.invirtwebstate.on': True,
     app_config = {
         '/': {
             'tools.invirtwebstate.on': True,
+            'tools.clear_db_cache.on': True,
             },
         }
 
             },
         }
 
@@ -62,7 +64,12 @@ if __name__ == "__main__":
         cherrypy.engine.start()
         cherrypy.engine.block()
     else:
         cherrypy.engine.start()
         cherrypy.engine.block()
     else:
-        cherrypy.engine.start(blocking=False)
+        cherrypy.server.unsubscribe()
+        try:
+            # Case that cherrypy < 3.1.0
+            cherrypy.engine.start(blocking=False)
+        except TypeError:
+            cherrypy.engine.start()
         from flup.server.fcgi import WSGIServer
         server = WSGIServer(cherrypy.tree)
         server.run()
         from flup.server.fcgi import WSGIServer
         server = WSGIServer(cherrypy.tree)
         server.run()