WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Service
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Service Script Fails to Notify Service Control Manager that it Started


Question:

Upon updating to WinBatch 2005B, my service scripts seem to be having an issue with Windows Service Control Manager. When ever I start a Winbatch service I get the following message from the Service Control Manager:
1053: The service did not respond to the start or control request in a timely fashion.

Answer:

Update

Starting in WinBatch 2005C Apr 7, 2005 we fixed a problem with the new service behavior introduced in 2005B, where the service state wasn't automatically getting set to SERVICE_RUNNING in some cases.


It looks like starting in 2005B, we added support for an additional "state" to SvcSetState:

Value  Service state             Meaning
-----  -------------             -------
2    SERVICE_START_PENDING     The service is starting
Made a change to the way WinBatch behaves when it runs as a service. Instead of launching with a state of SERVICE_RUNNING, it now launches with a state of SERVICE_START_PENDING. You can use SvcSetState to change the state to SERVICE_RUNNING, and if SvcSetState is not called within 3 seconds from the time the service launches, the state will automatically be changed to SERVICE_RUNNING.

Looks like all you will need to do is add the following line to the beginning of all of your scripts...

SvcSetstate (4) ;SERVICE_RUNNING
This should resolve the issue with the Service control manager returning that error.
Article ID:   W17263
File Created: 2007:07:03:14:29:04
Last Updated: 2007:07:03:14:29:04