Unable to start service register



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 Shah
.



Relevant Pages

  • Re: Find AD hostname from Linux command line
    ... The Windows XP workstation gets an IP ... "Register this connection's addresses in DNS" turned ON. ... If I am on a Linux server and do "ping lancelot.ad.mydomain.com", ...
    (microsoft.public.win2000.dns)
  • Re: Multihomed Domain Controller Setup
    ... > I recently upgraded my domain from Windows 2000 Active Directory to ... > Should I not use the second NICs and connect all DCs to live subnets ... Uncheck "Register this connection" under IP properties, ... In the DNS console, right click the server name, choose properties, then ...
    (microsoft.public.windows.server.active_directory)
  • USER PROFILE + DOMAIN CHANGE PROBLEM
    ... We recently had to change our main WINNT4 domain server to a W2K ... we had to change our Windows XP Pro workstations Network ... We can register DLLs we haven't built ourselves everywhere on the hard ...
    (microsoft.public.windowsxp.security_admin)
  • Re: PPTP ports missing in RRAS
    ... Insure that ALL NICS only point to your internal DNS server' IP ... to disable NetBIOS on the RRAS interfaces if this is a RRAS server. ... A standard Windows service, called the "Browser service", ... Uncheck "Register this connection" under IP properties, ...
    (microsoft.public.isa.vpn)
  • PPTP ports missing in RRAS Manoj (Oman)
    ... Insure that ALL NICS only point to your internal DNS server' IP ... to disable NetBIOS on the RRAS interfaces if this is a RRAS server. ... A standard Windows service, called the "Browser service", ... Uncheck "Register this connection" under IP properties, ...
    (microsoft.public.isa.vpn)