def SIGHUPstuff(*args): global configFile, configOptions xmlconfig.reloadConfig(configFile, configOptions) if config.pid and os.name != "posix": config.pid = "" debug.reloadConfig() legacy.reloadConfig()
def __init__(self): # Check for any other instances if config.pid and os.name != "posix": config.pid = "" if config.pid: twistd.checkPID(config.pid) # Do any auto-update stuff housekeep.init() # Daemonise the process and write the PID file if config.background and os.name == "posix": twistd.daemonize() if config.pid: self.writePID() # Initialise debugging, and do the other half of SIGHUPstuff debug.reloadConfig() legacy.reloadConfig() # Start the service jid = config.jid if config.useXCP and config.compjid: jid = config.compjid self.c = component.buildServiceManager( jid, config.secret, "tcp:%s:%s" % (config.mainServer, config.port)) self.transportSvc = PyTransport() self.transportSvc.setServiceParent(self.c) self.c.startService() reactor.addSystemEventTrigger('before', 'shutdown', self.shuttingDown)
def reloadConfig(a, b): LogEvent(INFO) # Reload default config and then process conf file reload(config) config.debugLevel = debugLevel config.debugFile = debugFile if len(options) > 0: xmlconfig.Import(conffile, options) else: xmlconfig.Import(conffile, None) debug.reloadConfig()
options[var] = setting elif o in ("-h", "--help"): print "./PyICQt [options]" print " -h print this help" print " -b daemonize/background transport" print " -c <file> read configuration from this file" print " -d print debugging output (very little)" print " -D print extended debugging output" print " -g print garbage collection output" print " -t print debugging only on traceback" print " -l <file> write debugging output to file" print " -o <var>=<setting> set config var to setting" sys.exit(0) config.debugLevel = debugLevel config.debugFile = debugFile debug.reloadConfig() xmlconfig.Import(conffile, options) def reloadConfig(a, b): LogEvent(INFO) # Reload default config and then process conf file reload(config) config.debugLevel = debugLevel config.debugFile = debugFile if len(options) > 0: xmlconfig.Import(conffile, options) else: xmlconfig.Import(conffile, None) debug.reloadConfig()
def reloadConfig(a, b): # Reload default config and then process conf file reload(config) xmlconfig.Import(conffile, None) debug.reloadConfig()
elif o in ("-o", "--option"): var, setting = v.split("=", 2) options[var] = setting elif o in ("-h", "--help"): print "./PyAIMt [options]" print " -h print this help" print " -b daemonize/background transport" print " -c <file> read configuration from this file" print " -d print debugging output (very little)" print " -D print extended debugging output" print " -g print garbage collection output" print " -t print debugging only on traceback" print " -l <file> write debugging output to file" print " -o <var>=<setting> set config var to setting" sys.exit(0) debug.reloadConfig() xmlconfig.Import(conffile, options) def reloadConfig(a, b): # Reload default config and then process conf file reload(config) xmlconfig.Import(conffile, None) debug.reloadConfig() # Set SIGHUP to reload the config file if os.name == "posix": import signal signal.signal(signal.SIGHUP, reloadConfig)