X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=web%2FMonitorWeb%2Fmonitorweb%2Fcommands.py;h=61b7c29ad0ef3adf2f77adf6930c6d8b95afdb1c;hb=4aa8a9bfafed28f85381f4f315cc4eb30c94d78b;hp=9e75f08d2f5a6031fdd812efe516ab88475a05e6;hpb=66ef9d90a94833d30502006d1fcdafd5054086eb;p=monitor.git diff --git a/web/MonitorWeb/monitorweb/commands.py b/web/MonitorWeb/monitorweb/commands.py index 9e75f08..61b7c29 100644 --- a/web/MonitorWeb/monitorweb/commands.py +++ b/web/MonitorWeb/monitorweb/commands.py @@ -2,7 +2,7 @@ """This module contains functions called from console script entry points.""" import sys -from os import getcwd +from os import getcwd, getpid from os.path import dirname, exists, join import pkg_resources @@ -45,6 +45,11 @@ def start(): except pkg_resources.DistributionNotFound: raise ConfigurationError("Could not find default configuration.") + if "prod" in configfile: + f = open("/var/run/monitorweb.pid", 'w') + f.write(str(getpid())) + f.close() + turbogears.update_config(configfile=configfile, modulename="monitorweb.config")