daemonUtils.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:plutaniumSmsServer 作者: babca 项目源码 文件源码
def reload(self, log_file=None, dump_stack_trace=False):
        print ('== RELOAD IS BUGGY ==')
        pid = self.pid

        if pid:
            try:
                int(pid) # "if pid is int". If not, an exception will be rised.

                os.kill(pid, signal.SIGHUP)

                time.sleep(5) # trochu hack, mozna by byl lepsi nejaky cyklus co kontroluje ukonceni daneho pidu, nebo tak neco
                # POZOR NEFUNGUJE SPRAVNE, NESTIHNE SE UKONCIT A NOVY SE NESPUSTI
                self.start(log_file=log_file, dump_stack_trace=dump_stack_trace) 
            except ValueError:
                print("The content of the pidfile is invalid!")
                print(pid)
        else:
            print ('Not Running')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号