{"action":"closed","issue":{"url":"https://api.github.com/repos/mhammond/pywin32/issues/1196","repository_url":"https://api.github.com/repos/mhammond/pywin32","labels_url":"https://api.github.com/repos/mhammond/pywin32/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/mhammond/pywin32/issues/1196/comments","events_url":"https://api.github.com/repos/mhammond/pywin32/issues/1196/events","html_url":"https://github.com/mhammond/pywin32/issues/1196","id":312870236,"number":1196,"title":"Service is stuck in Starting state","user":{"login":"FloTeamO","id":10049032,"avatar_url":"https://avatars2.githubusercontent.com/u/10049032?v=4","gravatar_id":"","url":"https://api.github.com/users/FloTeamO","html_url":"https://github.com/FloTeamO","followers_url":"https://api.github.com/users/FloTeamO/followers","following_url":"https://api.github.com/users/FloTeamO/following{/other_user}","gists_url":"https://api.github.com/users/FloTeamO/gists{/gist_id}","starred_url":"https://api.github.com/users/FloTeamO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FloTeamO/subscriptions","organizations_url":"https://api.github.com/users/FloTeamO/orgs","repos_url":"https://api.github.com/users/FloTeamO/repos","events_url":"https://api.github.com/users/FloTeamO/events{/privacy}","received_events_url":"https://api.github.com/users/FloTeamO/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-10T10:50:11Z","updated_at":"2018-04-10T10:51:12Z","closed_at":"2018-04-10T10:51:12Z","author_association":"NONE","body":"Hi,\r\nI am new to 'pywin32'  but I was able to create very quickly a new Windows service for my purpose thanks to your work!\r\nUnfortunatelly when I `install` and then `start` my service, it gets stucked in `Starting` state and then I have no chance to `stop` or remove it except by restarting the computer.\r\nHere is the code I use, could you help me on this one?\r\nI added this line `self.ReportServiceStatus(win32service.SERVICE_RUNNING)` in `SvcDoRun` function compared to your example but it did not change anything.\r\nThanks\r\n\r\n```\r\n#!/usr/bin/env python3\r\n\r\nimport win32service\r\nimport win32serviceutil\r\nimport win32event\r\nimport servicemanager\r\n\r\n\r\nclass MyClass(win32serviceutil.ServiceFramework):\r\n    # you can NET START/STOP the service by the following name\r\n    _svc_name_ = \"My_CLASS\"\r\n    # this text shows up as the service name in the Service\r\n    # Control Manager (SCM)\r\n    _svc_display_name_ = \"MY_CLASS\"\r\n    # this text shows up as the description in the SCM\r\n    _svc_description_ = \"MY_DESC\"\r\n\r\n    def __init__(self, args):\r\n        # create Windows Service\r\n        win32serviceutil.ServiceFramework.__init__(self, args)\r\n        self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)  # create an event to listen for stop requests on\r\n\r\n    def SvcDoRun(self):\r\n        self.ReportServiceStatus(win32service.SERVICE_RUNNING)\r\n        win32event.WaitForSingleObject(self.hWaitStop, win32event.INFINITE)\r\n\r\n    def SvcStop(self):\r\n        # tell the SCM we're shutting down\r\n        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)\r\n        # fire the stop event\r\n        win32event.SetEvent(self.hWaitStop)\r\n```"}}
{"actor":{"display_login":"FloTeamO"}}