Windows Server 2008 Forum: Unable to start the service registered - Windows Server 2008 Forum

Jump to content

Hello Guest

Windows Server 2008 Forum is a free help and support community. If have problems installing Windows Server 2008 or just want to interact with other Windows 2008 users then Windows Server 2008 Forum is the place for you. If this is your first visit to Windows Server 2008 Forum be sure to check out Help. You have to register before you can post. Registration to Windows Server 2008 Forum is free so why not register today?
If you want to browse the site a bit before you register you can start viewing messages by selecting the forum that you want to visit from the selection below.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Unable to start the service registered Rate Topic: -----

#1 User is offline   romilshah Icon

  • Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 01-April 08

Posted 01 Apr 2008 - 12:36 AM

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 : NULL
Password : NULL
Service name : diradm_xyz
description: 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
0

#2 User is offline   BSchwarz Icon

  • Administrator
  • Icon
  • Group: Administrators
  • Posts: 483
  • Joined: 31-October 09
  • Location: Joliet, IL, U.S.A.

Posted 01 Apr 2008 - 01:09 PM

There is a difference in the way services are handled. Services that would install and run on 2003 don't work on 2008. I haven't had a chance to look deeper into the difference. I really should take the time because I know this type of problem will hit me when I start to migrate clients from 2003 to Windows 2008 Server.
Please post what you find and I will do the same.
0

#3 User is offline   romilshah Icon

  • Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 01-April 08

Posted 02 Apr 2008 - 12:50 AM

Sure , plz post ur update in case you get some break through in this problem .
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users