示例#1
0
 def _sigkill(self, pid, signum):
     try:
         os.kill(pid, signum)
     except:
         logger().debug("Non existant pid {0}".format(pid))
示例#2
0
 def _restart(self, options):
     wsgidapp = WsgidApp(options.app_path)
     logger().info("Restarting worker processes at {0}...".format(
         options.app_path))
     pids = wsgidapp.worker_pids()
     self._kill_pids(pids, options.send_signal, 'worker')
示例#3
0
 def _kill_pids(self, pids, signum, pidtype):
     for pidnumber in pids:
         logger().debug(
             "Sending signal {sig} to {pidtype} pid={pid}".format(
                 pid=pidnumber, sig=signum, pidtype=pidtype))
         self._sigkill(pidnumber, signum)
示例#4
0
 def _stop(self, options):
     wsgidapp = WsgidApp(options.app_path)
     logger().info("Stopping master processes at {0}...".format(
         options.app_path))
     pids = wsgidapp.master_pids()
     self._kill_pids(pids, options.send_signal, 'master')
示例#5
0
文件: manage.py 项目: ildus/wsgid
 def _sigkill(self, pid, signum):
   try:
     os.kill(pid, signum)
   except:
     logger().debug("Non existant pid {0}".format(pid))
示例#6
0
文件: manage.py 项目: ildus/wsgid
 def _kill_pids(self, pids, signum, pidtype):
   for pidnumber in pids:
     logger().debug("Sending signal {sig} to {pidtype} pid={pid}".format(pid=pidnumber, sig=signum, pidtype=pidtype))
     self._sigkill(pidnumber, signum)
示例#7
0
文件: manage.py 项目: ildus/wsgid
 def _restart(self, options):
   wsgidapp = WsgidApp(options.app_path)
   logger().info("Restarting worker processes at {0}...".format(options.app_path))
   pids = wsgidapp.worker_pids()
   self._kill_pids(pids, options.send_signal, 'worker')
示例#8
0
文件: manage.py 项目: ildus/wsgid
 def _stop(self, options):
   wsgidapp = WsgidApp(options.app_path)
   logger().info("Stopping master processes at {0}...".format(options.app_path))
   pids = wsgidapp.master_pids()
   self._kill_pids(pids, options.send_signal, 'master')