summaryrefslogtreecommitdiffstats
path: root/funcweb
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-07-07 15:20:23 +0300
committermakkalot <makkalot@gmail.com>2008-07-07 15:20:23 +0300
commit21fcc31a4adf2e86198f0d134f133d5d2a839624 (patch)
tree94f25edfcb3b6c4c722d7716e34dcfc10f9f7519 /funcweb
parentbb2769a62e687cf9939d0604f8af44a3a384b75b (diff)
downloadfunc-21fcc31a4adf2e86198f0d134f133d5d2a839624.tar.gz
func-21fcc31a4adf2e86198f0d134f133d5d2a839624.tar.xz
func-21fcc31a4adf2e86198f0d134f133d5d2a839624.zip
use the func's utils to deamonize the funcwebd :)
Diffstat (limited to 'funcweb')
-rw-r--r--funcweb/funcweb/commands.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/funcweb/funcweb/commands.py b/funcweb/funcweb/commands.py
index 578fe23..154309a 100644
--- a/funcweb/funcweb/commands.py
+++ b/funcweb/funcweb/commands.py
@@ -11,6 +11,7 @@ pkg_resources.require("TurboGears")
import turbogears
import cherrypy
+import func.utils as futils
cherrypy.lowercase_api = True
@@ -56,5 +57,12 @@ def start():
modulename="funcweb.config")
from funcweb.controllers import Root
-
- turbogears.start_server(Root())
+
+ if exists("/etc/funcweb/prod.cfg"):
+ futils.daemonize("/var/run/funcwebd.pid")
+ #then start the server
+ try:
+ turbogears.start_server(Root())
+ except Exception,e:
+ print "Exception occured :",e
+ sys.exit(1)