Unable to start service registered
Hi,I am facing problem in starting an application registered as a service on Windows 2008 server. Given below are the details steps :Code snippet used to register a service :// Open a connection to the service control manager on// the local machine.srvManager = OpenSCManager( NULL,NULL,SC_MANAGER_ALL_ACCESS);// If can't get a connection, we have to return.if (srvManager == NULL) {Debug(LDAP_DEBUG_TRACE,"getCurrentProcessSID: OpenSCManager failed errno=%d.\n", GetLastError());return ldtr_rc(LDAP_OPERATIONS_ERROR);}dwStartType = SERVICE_AUTO_START;// Now try to create the service.ptrService = CreateService(// pointer to the service control manager.srvManager,// The name of the service.service_name,// The display name description of the service.description,SERVICE_ALL_ACCESS,SERVICE_WIN32_OWN_PROCESS,// If the service is auto started or now.dwStartType,SERVICE_ERROR_NORMAL,// The command to run and parameters to pass it.command,NULL,NULL,NULL,// The user id to run the service under.userid,// The password of the id to run the service under.password);Value of the parameter passed to the above mentioned function is :command : c:\diradm.cmd --> script used in to invoke the require binary .userid : NULLPassword : NULLService name : diradm_xyzdescription: Service used to start the server On running this piece of code , I see a service registered under Administrator -> Services I tried to run the service from the Services panel , but I see the error on the console as :Error 1053, The service did not responded to the start or control request in a timely fashion . I have debug statement in the diradmd.cmd file which should be redirected to a log file. It seems that diradm.cmd is not called by service registered !The strange part is that the same piece of code works fine on Windows 2003 server so what I am missing for Windows 2008 ? Note in case of Win 2003 , I have set the dependency on Lan Manager and here I have passes it as NULL.Looking forward for your suggestion ,Thanks,Romil Shah
April 2nd, 2008 9:45am

Hello, Based on some research, I find this error may be related to the .NET Framework. The following article gives some clues: FIX: You receive an "Error 1053: The service did not respond to the start or control request in a timely fashion" error message when you stop or pause a managed Windows service http://support.microsoft.com/kb/839174 Besides, it appears that this is a development related request and would best be addressed in the Developer newsgroups (or forums). I have provided the links below: http://forums.microsoft.com/msdn http://msdn.microsoft.com/newsgroups/default.asp I hope this issue will be resolved soon. Thanks for your understanding. Best regards, Chang Yin Microsoft Online Community Support
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2008 2:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics