fixed the httpd conf issue with redirecting to /monitor/
[monitor.git] / web / MonitorWeb / monitorweb / commands.py
index 9e75f08..68df39c 100644 (file)
@@ -2,7 +2,7 @@
 """This module contains functions called from console script entry points."""\r
 \r
 import sys\r
-from os import getcwd\r
+from os import getcwd, getpid\r
 from os.path import dirname, exists, join\r
 \r
 import pkg_resources\r
@@ -45,6 +45,11 @@ def start():
         except pkg_resources.DistributionNotFound:\r
             raise ConfigurationError("Could not find default configuration.")\r
 \r
+       if "prod" in configfile:\r
+               f = open("/var/run/monitorweb.pid", 'w')\r
+               f.write(str(getpid()))\r
+               f.close()\r
+\r
     turbogears.update_config(configfile=configfile,\r
         modulename="monitorweb.config")\r
 \r