Windows could not start service on Win Server 2008 R2 SP1 (Error 1053)

一笑奈何 提交于 2019-12-04 00:07:41

I've figured out what was going on in a few steps:

  1. I've written console application - wrapper for what is basically done in OnStart method from service.
  2. I've executed console application - application started normally.
  3. I've copied content of service configuration file to console application configuration file.
  4. I've executed console application once again - application aborted silently and immediately (surprisingly similar to our service behavior, something is wrong).
  5. I've compared 2 configs - from service, and original from console application. As a result I've found some differences. Among others, there was such an entry - the source of the problem (after removal, everything works):

    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    

So basically I had out of date configuration file. Previously service was compiled under .NET 4.5, then I've changed the framework to 4.0 and deployed files to the server, but left the previous configuration file (I've changed the target framework because my development machine has .NET 4.5 while server does not). I wouldn't have thought the shown lines would hide all problems without any reasonable information, which could help to track the mess.

Check for missing dependencies/DLLs.

If you haven't already done so, allow your service to be invoked as a regular application (a great technique for long-term debugging) and see if it starts properly on your Windows 2008 machine.

If works that way, then there may be an issue with running in the LocalSystem account. Move on to starting your application from a command prompt running in the LocalSystem account (example setup here).

Ramachandran Gokulachandran

I tried the following fix which was provided at this link

  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.

But still I had the problem to start the service.

The fix which worked for me was,

  1. Go the services.msc
  2. Double click the service which you are trying to start.
  3. Take the Logon Tab
  4. Changed Log on as: to Local System account.
  5. Tried starting the service after this change.(Still gave the 1053 error)
  6. Took the Log on tab again, changed it to Network Service (gave a random new password)
  7. Tried starting the service again.(The service started perfectly)

I tried the below steps. It worked like a charm.

1.Go the services.msc 2.Double click the service which you are trying to start. 3.Take the Logon Tab 4.Changed Log on as: to Local System account. 5.Tried starting the service after this change.(Still gave the 1053 error) 6.Took the Log on tab again, changed it to Network Service (gave a random new password) 7.Tried starting the service again.(The service started perfectly)

But I just want to know what will be the issue.

After installing service, i have to gave full control permission(Everyone) for installation folder. Then, my service will started perfectaly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!