示例#1
0
def main(**kwargs):
    try:

        gate = Gateway(**kwargs)
        gate.run()
    except KeyboardInterrupt:
        logging.error("%s: process stopped by user" % (time.strftime("%d%b%Y,%H:%M")))
        sys.exit()
示例#2
0
文件: smsd.py 项目: wends155/modem
	def run(self, **kwargs):
		import sys
		from modem import Gateway

		try:
			gate = Gateway(**kwargs)
			gate.run()

			
		except SystemExit:
			logging.error("%s: Gateway SIGTERM, exiting" % time.strftime("%d%b%Y,%H:%M"))
			sys.exit(0)
示例#3
0
def run():
	import gevent.monkey
	gevent.monkey.patch_time()
	import atexit
	import gevent
	import signal
	
	
	def sigstop():
		sys.exit()
	gevent.signal(signal.SIGTERM,sigstop)
	

	def delpid():
		os.remove('test.pid')
	atexit.register(delpid)
	from modem import Gateway
	gate = Gateway()
	gate.run()