locked
Service won't start RRS feed

  • Question

  • I have a service that installs fine but when I try and start it I get the old "Error 1053: The service did not respond to the start or control request in a timely fashion." I have 2 other services that use the same code ( cut and paste jobs ) to define the service method overrides and they are all working fine.

    I have tried to change to Network Service, Local Service, Local System, and User and none will start up. Any ideas. The articles I have found are old talk about Framework 1.1 and I am running 4.They also only target MS installed services, not user created ones.

    Oh yeah, it installs locally on my Vista machine fine, it is a WS 2003 machine with the hiccup, but like I said I have 2 other services I created on it running fine.

     

     

    Here is my OnStart:

     

    private
     System.Timers.Timer _timer;
    
      public
     MyService()
      {
       InitializeComponent();
      }
    
      protected
     override
     void
     OnStart(string
    [] args)
      {
       double
     timerInterval = GetTimerInterval();
    
       _timer = new
     System.Timers.Timer();
       _timer.AutoReset = true
    ;
       _timer.Elapsed += new
     System.Timers.ElapsedEventHandler(TimerTick);
       _timer.Interval = timerInterval * 1000; // Interval is saved in seconds, timer needs milliseconds so convert
    
       _timer.Start();
       GC.KeepAlive(_timer);
    
      }
    

     

     

     

    Tuesday, March 1, 2011 4:54 PM

Answers

  • Hi Michael,

    I think we should try to make some attempts to narrow your issue down. After I checked your question, it looks that this issue occurred on Windows Server 2003 machine. Here I found a KB about Error 1053 and solution, I think it will help you. Please check it.

    If you have any finding, please feel free to let me know.

    Hope this helps,

    Sincerely,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 10, 2011 1:30 PM

All replies

  • Try to change the method with OnLoad():

      protected override void OnLoad(EventArgs e)
      {
       base.OnLoad(e);
      }
    

     

    like:

      public partial class Form1 : Form
      {
        private System.Timers.Timer _timer;
    
        public Form1()
        {
          InitializeComponent();
        }
    
        protected override void OnLoad(EventArgs e)
        {
          base.OnLoad(e);
          double timerInterval = 5;// GetTimerInterval();
    
          _timer = new System.Timers.Timer();
          _timer.AutoReset = true;
          _timer.Elapsed += new System.Timers.ElapsedEventHandler(TimerTick);
          _timer.Interval = timerInterval * 1000; // Interval is saved in seconds, timer needs milliseconds so convert
          _timer.Start();
          GC.KeepAlive(_timer);
        }
    
        private void TimerTick(object obj, EventArgs e)
        { 
        
        }
      }

     

    Mitja

    Tuesday, March 1, 2011 5:04 PM
  • Is there an OnLoad method on Windows Services? This is a non UI service.
    Tuesday, March 1, 2011 5:12 PM
  • Any takers?
    Tuesday, March 1, 2011 6:47 PM
  • Symptom:

    Sometimes after applying a Security Hotfix, Reporting Services failed to start with the error message, “Error 1053 is received: The service did not respond to the start or control request in a timely fashion”.

    Solution:

    The problem is usually caused by an incorrect timeout setting. To work around the issue, try the following steps: 1. Click Start, click Run, type regedit, and then click OK. 2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control 3. In the right pane, locate the ServicesPipeTimeout entry.Note If the ServicesPipeTimeout entry does not exist, you must create it. To do this, follow these steps: a. On the Edit menu, point to New, and then click DWORD Value. b. Type ServicesPipeTimeout, and then press ENTER. 4. Right-click ServicesPipeTimeout, and then click Modify. 5. Click Decimal, type 60000, and then click OK. This value represents the time in milliseconds before a service times out. 6. Restart the computer.

    For more info: 

    http://stackoverflow.com/questions/158371/error-1053-the-service-did-not-respond-to-the-start-or-control-request-in-a-time

    http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/b57ee42d-42ef-44a4-9670-be9088dbf9d4/

    You might find some useful info.

    Tuesday, March 1, 2011 7:42 PM
  • Thanks, I have read those.

     

    I added the registry setting to the server but I cannot reboot during the day for such a small reason.

     

     

    Tuesday, March 1, 2011 8:21 PM
  • Any update?

    Best Regards,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 7, 2011 2:35 PM
  • Have you checked the application logs?

    What do they say? Anything worth reading?

    Adam


    Ctrl+Z
    Monday, March 7, 2011 3:08 PM
  • The logs are not helpful. I think it is an issue with the framework. The server in question has the .Net 4 client profile installed but not the full framework. I have had issues with services built under the client framework not working well and being able to reference all the external assemblies I need. I went back and added it as an install condition but my IT dude has not installed in yet for me to see fit that is the issue.
    Wednesday, March 9, 2011 9:59 PM
  • Hi Michael,

    I think we should try to make some attempts to narrow your issue down. After I checked your question, it looks that this issue occurred on Windows Server 2003 machine. Here I found a KB about Error 1053 and solution, I think it will help you. Please check it.

    If you have any finding, please feel free to let me know.

    Hope this helps,

    Sincerely,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 10, 2011 1:30 PM