# -*- coding: utf-8 -*- from service_utils import main, CmdService import os import sys import redis_self from subprocess import Popen path = os.path.split(__file__)[0] class ZKECOMemCachedService(CmdService): _svc_name_ = "ZKECOMemCachedService" _svc_display_name_ = "ZKECO MemCached Service" path = path cmd_and_args = ["memcached.exe", "-p 11211 -l 127.0.0.1 -m 128"] if __name__ == '__main__': main(ZKECOMemCachedService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class ZksaasAdmsService(DjangoService): _svc_name_ = "ZKECOZksaasAdmsService" _svc_display_name_ = "ZKECO Zksaas ADMS Service" _svc_deps_ = [] path = path cmd_and_args=["zksaas_adms"] if __name__=='__main__': main(ZksaasAdmsService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class ZkposAdmsService(DjangoService): _svc_name_ = "ZKECOZkposAdmsService" _svc_display_name_ = "ZKECO Zkpos ADMS Service" _svc_deps_ = [] path = path cmd_and_args=["zkpos_adms"] if __name__=='__main__': main(ZkposAdmsService)
import sys import redis from subprocess import Popen path=os.path.split(__file__)[0] def start_q_server(stdout=None): exe_name=redis.__path__[0]+"/redis-server" if not os.name=='posix': exe_name+=".exe" return Popen(exe_name, stdout=stdout) class QueqeService(CmdService): _svc_name_ = "iClockQueqeService" _svc_display_name_ = "iClock Queqe Service" path = path def cmd_and_args(self): q=redis.Redis(host='localhost', port=6379, db=0) try: q.ping() except redis.exceptions.ConnectionError: return start_q_server(self.logger.handlers[0].stream) except redis.exceptions.InvalidResponse: pass def stop_fun(self, process): if not process: return q=redis.Redis(host='localhost', port=6379, db=0) q.save() if __name__=='__main__': main(QueqeService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class ZksaasAdmsService(DjangoService): _svc_name_ = "ZKECOZksaasAdmsService" #---服务名称 _svc_display_name_ = "ZKECO Zksaas ADMS Service" #---显示名称 _svc_deps_ = [] path = path cmd_and_args=["zksaas_adms"] #---命令参数 if __name__=='__main__': main(ZksaasAdmsService)
from service_utils import main, PythonService import os path=os.path.split(__file__)[0] class ZKECOADMSService(PythonService): _svc_name_ = "ZKECOWEBService" _svc_display_name_ = "ZKECO Web Service" _svc_deps_ = [] path = path cmd_and_args=["svr8000.pyc", ] def stop_fun(self, process): os.system("""taskkill /IM nginx.exe /F""") if __name__=='__main__': main(ZKECOADMSService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class ServiceInstantMsg(DjangoService): _svc_name_ = "ZKECOInstantMessage" _svc_display_name_ = "ZKECO Worktable Instant Message" _svc_deps_ = [""] path = path cmd_and_args=["instantmsg"] if __name__=='__main__': main(ServiceInstantMsg)
from service_utils import main, DjangoService import os import sys path = os.path.split(__file__)[0] class ServiceBackupDB(DjangoService): _svc_name_ = "ZKECOBackupDB" _svc_display_name_ = "ZKECO Backup Database" _svc_deps_ = [""] path = path cmd_and_args = ["dbadmin"] if __name__ == '__main__': main(ServiceBackupDB)
from service_utils import main, DjangoService import os path=os.path.split(__file__)[0] class iClockDBPoolService(DjangoService): _svc_name_ = "iClockDBPoolService" _svc_display_name_ = "iClock DB Pool Service" _svc_deps_ = ["iClockQueqeService"] path = path cmd_and_args=["writedata"] if __name__=='__main__': main(iClockDBPoolService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class WriteDataService(DjangoService): _svc_name_ = "ZKECOWriteDataService" _svc_display_name_ = "ZKECO Write Data Service" _svc_deps_ = [] path = path cmd_and_args=["writedata"] if __name__=='__main__': main(WriteDataService)
from service_utils import main, DjangoService import os path = os.path.split(__file__)[0] class iClockDBPoolService(DjangoService): _svc_name_ = "iClockDBPoolService" _svc_display_name_ = "iClock DB Pool Service" _svc_deps_ = ["iClockQueqeService"] path = path cmd_and_args = ["writedata"] if __name__ == '__main__': main(iClockDBPoolService)
import sys import redis_self from subprocess import Popen path=os.path.split(__file__)[0] def start_q_server(stdout=None): exe_name=redis_self.__path__[0]+"/redis-server" if not os.name=='posix': exe_name+=".exe" return Popen(exe_name, stdout=stdout) class QueqeService(CmdService): _svc_name_ = "iClockQueqeService" _svc_display_name_ = "iClock Queqe Service" path = path def cmd_and_args(self): q=redis_self.Redis(host='localhost', port=6379, db=0) try: q.ping() except redis_self.exceptions.ConnectionError: return start_q_server(self.logger.handlers[0].stream) except redis_self.exceptions.InvalidResponse: pass def stop_fun(self, process): if not process: return q=redis_self.Redis(host='localhost', port=6379, db=0) q.save() if __name__=='__main__': main(QueqeService)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class AutoCalculateService(DjangoService): _svc_name_ = "ZKECOAutoCalculateService" _svc_display_name_ = "ZKECO Automatic Calculate Service" _svc_deps_ = [] path = path cmd_and_args=["autocalculate"] if __name__=='__main__': main(AutoCalculateService)
def delete_server_key(): fqpath = "%s/_fqueue/" % (os.getcwd()) q_server = queqe_server_path(fqpath) q_server.delete("CENTER_RUNING") q_server.connection.disconnect() class ServiceDataCommCenter(DjangoService): _svc_name_ = "ZKECODataCommCenterService" _svc_display_name_ = "ZKECO Data Comm Center Service" _svc_deps_ = [""] path = path cmd_and_args = ["datacommcenter"] def SvcStop(self): printf("*******ServiceDataCommCenter stop", True) set_center_stop() while check_center_stop(): time.sleep(1) killall_pid() if check_center_stop(): return delete_server_key() self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) sys.stopservice = "true" win32event.SetEvent(self.hWaitStop) if __name__ == '__main__': main(ServiceDataCommCenter)
from service_utils import main, DjangoService import os import sys path=os.path.split(__file__)[0] class ServiceBackupDB(DjangoService): _svc_name_ = "ZKECOBackupDB" _svc_display_name_ = "ZKECO Backup Database" _svc_deps_ = [""] path = path cmd_and_args=["dbadmin"] if __name__=='__main__': main(ServiceBackupDB)