33 def gentle_exit(signal, frame):
34 logger.critical(
"signal caught, exiting")
43 def start_daemon(pidfile):
46 if e !=
'-B' and e !=
'--background':
48 logger.debug(
"Starting background process...")
49 pid = os.spawnv(os.P_NOWAIT,arg[0], arg)
50 fdpid = open(pidfile,
"w+")
54 logger.debug(
"Background process started. Pid = "+str(pid))
63 def runMonitorStages(com, stages, maxretry):
69 com.runAuth(P2Furn.userId(args[
'user']))
73 logger.error(
"Authentication stage failed : "+str(e))
76 logger.critical(
"Authentication stage failed again after "+str(maxretry)+
" attempts")
87 logger.error(
"Initialisation stage failed : "+str(e))
90 logger.critical(
"Initialisation stage failed again after "+str(maxretry)+
" attempts")
97 com.readData(float(args[
'data_wait']),storage)
101 logger.error(
"DataReading stage failed : "+str(e))
104 logger.critical(
"DataReading stage failed again after "+str(maxretry)+
" attempts")