From c0b5bcc7d3add7f3fe331d87f314daee12c5dce5 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 13 Oct 2009 11:32:40 +0000 Subject: [PATCH] add the option to fork the webui --- deluge/ui/web/web.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/deluge/ui/web/web.py b/deluge/ui/web/web.py index 4347b983b..b5fd20815 100644 --- a/deluge/ui/web/web.py +++ b/deluge/ui/web/web.py @@ -33,6 +33,8 @@ # # +import os + from deluge.ui.ui import _UI, UI from optparse import OptionGroup @@ -51,6 +53,9 @@ class Web(_UI): self.__server = None group = OptionGroup(self.parser, "Web Options") + group.add_option("-f", "--fork", dest="fork", + help="Fork the web interface process into the background", + action="store_true", default=False) group.add_option("-p", "--port", dest="port", type="int", help="Sets the port to be used for the webserver", action="store", default=None) @@ -72,6 +77,11 @@ class Web(_UI): def start(self): super(Web, self).start() + if self.options.fork: + if os.fork(): + exit(0) + + import server self.__server = server.DelugeWeb()