Python win32service.SERVICE_STOP_PENDING Examples

The following are 21 code examples of win32service.SERVICE_STOP_PENDING(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module win32service , or try the search function .
Example #1
Source File: service_wrapper.py    From resilient-python-api with MIT License 5 votes vote down vote up
def SvcStop(self):
        import servicemanager
        msg = "stopping."
        try:
            # There's no way to say this nicely
            self.process_handle.terminate()
        except Exception as exc:
            msg = exc.message
            pass
        servicemanager.LogInfoMsg(self._svc_name_ + " - Received stop signal; " + msg)
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        self.isAlive = False 
Example #2
Source File: Backdoor-ing Legitmate Windows Service.py    From Python-for-Offensive-PenTest with MIT License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) #tell the Service Manager that we are planing to stop the serivce
        self.stop()
        self.ReportServiceStatus(win32service.SERVICE_STOPPED) #tell the Service Manager that we are currently stopping the service 
Example #3
Source File: Create a New Admin account.py    From Python-for-Offensive-PenTest with MIT License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        self.stop()
        self.ReportServiceStatus(win32service.SERVICE_STOPPED) 
Example #4
Source File: win32.py    From moviegrabber with GNU General Public License v3.0 5 votes vote down vote up
def SvcStop(self):
        from cherrypy import process
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        process.bus.exit() 
Example #5
Source File: win32.py    From Tautulli with GNU General Public License v3.0 5 votes vote down vote up
def SvcStop(self):
        from cherrypy import process
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        process.bus.exit() 
Example #6
Source File: win32.py    From bazarr with GNU General Public License v3.0 5 votes vote down vote up
def SvcStop(self):
        from cherrypy import process
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        process.bus.exit() 
Example #7
Source File: powermonitor.py    From code with MIT License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(svc.SERVICE_STOP_PENDING)
        self.stop()
        self.ReportServiceStatus(svc.SERVICE_STOPPED) 
Example #8
Source File: DaemonCmd.py    From grease with MIT License 5 votes vote down vote up
def SvcStop(self):
            self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
            win32event.SetEvent(self.hWaitStop) 
Example #9
Source File: windows_service.py    From opsbro with MIT License 5 votes vote down vote up
def SvcStop(self):
        import servicemanager
        # tell windows SCM we're shutting down
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        servicemanager.LogInfoMsg("OpsBro Start")
        # launch the stop event
        win32event.SetEvent(self.hWaitStop) 
Example #10
Source File: win32.py    From opsbro with MIT License 5 votes vote down vote up
def SvcStop(self):
        from cherrypy import process
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        process.bus.exit() 
Example #11
Source File: service_win32.py    From mamonsu with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop) 
Example #12
Source File: win32.py    From cherrypy with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def SvcStop(self):
        from cherrypy import process
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        process.bus.exit() 
Example #13
Source File: socketserverservice.py    From execnet with MIT License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop) 
Example #14
Source File: platform_windows.py    From scalyr-agent-2 with Apache License 2.0 5 votes vote down vote up
def SvcStop(self):
        self.log("Stopping scalyr service")
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self._stop_event)
        self.controller.invoke_termination_handler()
        self.ReportServiceStatus(win32service.SERVICE_STOPPED) 
Example #15
Source File: ceajenkins.py    From CityEnergyAnalyst with MIT License 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop)
        self._running = False 
Example #16
Source File: windows_webservice.py    From Chinese-RFID-Access-Control-Library with MIT License 5 votes vote down vote up
def SvcStop(self):
		self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
		cherrypy.engine.exit()
		
		self.ReportServiceStatus(win32service.SERVICE_STOPPED) 
		# very important for use with py2exe
		# otherwise the Service Controller never knows that it is stopped ! 
Example #17
Source File: SMWinservice.py    From biometric-attendance-sync-tool with GNU General Public License v3.0 5 votes vote down vote up
def SvcStop(self):
        '''
        Called when the service is asked to stop
        '''
        self.stop()
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop) 
Example #18
Source File: win32serviceutil.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def SvcRun(self):
        self.ReportServiceStatus(win32service.SERVICE_RUNNING)
        self.SvcDoRun()
        # Once SvcDoRun terminates, the service has stopped.
        # We tell the SCM the service is still stopping - the C framework
        # will automatically tell the SCM it has stopped when this returns.
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) 
Example #19
Source File: serviceEvents.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop) 
Example #20
Source File: pipeTestService.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        SetEvent(self.hWaitStop) 
Example #21
Source File: agent.py    From Windows-Agent with Apache License 2.0 5 votes vote down vote up
def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop)
        self.isAlive = False