title: all python windows service can not start{error 1053}
body: <p><strong>all</strong> python code service can install but cannot start</p>
  <p><code>Error 1053: The service did not respond to the start or control request in a timely fashion&quot;.</code></p>
  <p>since my service <em>can install and start in my server</em>.
  i think my code has no problem.</p>
  <p>but i still wonder is there a solution that i can solve this error in code</p>
  <p>my service:</p>
  <pre><code>import win32serviceutil
  import win32service
  import win32event
  
  import time
  import traceback
  import os
  
  import ConfigParser
  import time
  import traceback
  import os
  import utils_func
  from memcache_synchronizer import *
  
  class MyService(win32serviceutil.ServiceFramework):
      &quot;&quot;&quot;Windows Service.&quot;&quot;&quot;
      os.chdir(os.path.dirname(__file__))
      conf_file_name = &quot;memcache_sync_service.ini&quot;
      conf_parser = ConfigParser.SafeConfigParser()
      conf_parser.read(conf_file_name)
      _svc_name_, _svc_display_name_, _svc_description_ = utils_func.get_win_service(conf_parser)
  
      def __init__(self, args):
          if os.path.dirname(__file__):
              os.chdir(os.path.dirname(__file__))
          win32serviceutil.ServiceFramework.__init__(self, args)
  
          # create an event that SvcDoRun can wait on and SvcStop can set.
          self.stop_event = win32event.CreateEvent(None, 0, 0, None)
  
      def SvcDoRun(self):
          self.Run()
          win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE)
  
      def SvcStop(self):
          self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
          win32event.SetEvent(self.stop_event)
          LoggerInstance.log(&quot;memcache_sync service is stopped&quot;)
          self.ReportServiceStatus(win32service.SERVICE_STOPPED)
          sys.exit()
  
      def Run(self):
          try:
              LoggerInstance.log(&quot;\n******\n\memcache_sync_service is running, configuration: %s\n******&quot; % (self.conf_file_name,))
              if ((not self.conf_parser.has_section('Memcache')) or
                  (not self.conf_parser.has_option('Memcache', 'check_interval'))):
                  LoggerInstance.log('memcache_sync_service : no Memcache service parameters')
                  self.SvcStop()
  
              # set configuration parameters from ini configuration
              self.check_interval = self.conf_parser.getint('Memcache', 'check_interval')
  
              ms = MemcacheSynchronizer()
              while 1:
                  ms.Sync()
                  time.sleep(self.check_interval)
          except:
              LoggerInstance.log(&quot;Unhandled Exception \n\t%s&quot; % (traceback.format_exc(),))
  
  
  if __name__ == '__main__':
      win32serviceutil.HandleCommandLine(MyService)
  </code></pre>
  <p>execute result of &quot;sc query [name]&quot; cmd:</p>
  <blockquote>
  <p>SERVICE_NAME: NewsMonitoringMemcacheSynchronizer</p>
  <pre><code>   TYPE               : 10  WIN32_OWN_PROCESS 
     STATE              : 1  STOPPED 
                             (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
     WIN32_EXIT_CODE    : 0 (0x0)
     SERVICE_EXIT_CODE  : 0 (0x0)
     CHECKPOINT         : 0x0
     WAIT_HINT          : 0x0
  </code></pre>
  </blockquote>
  <p><strong>update:</strong></p>
  <p>i can run this service with debug mode, cmd:</p>
  <pre><code>memcache_syn_service.py debug
  </code></pre>