Windows Server 2008 Forum

Login or register to remove this ad.

Go Back   Windows Server 2008 Forum > Windows 2008 Features Help and Discussions > Network and Security

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



Reply
 
LinkBack Thread Tools Display Modes
Old 04-01-2008, 01:36 AM   #1
Member
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
romilshah is on a distinguished road
Default Unable to start the 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 : 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
romilshah is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-01-2008, 02:09 PM   #2
Administrator
 
BSchwarz's Avatar
 
Join Date: Feb 2008
Location: Joliet, IL, U.S.
Posts: 216
Blog Entries: 15
Rep Power: 10
BSchwarz has disabled reputation
Send a message via AIM to BSchwarz Send a message via Yahoo to BSchwarz
Default Re: Unable to start the service registered

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.
BSchwarz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-02-2008, 01:50 AM   #3
Member
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
romilshah is on a distinguished road
Default Re: Unable to start the service registered

Sure , plz post ur update in case you get some break through in this problem .
romilshah is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
registered, service, start, unable



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -6. The time now is 07:28 AM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2008 Windows Server 2008 Forum and Robert Schwarz. All rights reserved.
Windows Server 2008 Forum is an independent web site and is not affiliated with Microsoft Corporation.