IceBox as manually installed Windows Service: Event ID 7009
I am trying to deploy a windows service bypassing IceGridNode for a specific purpose as standalone Icebox Windows Service. I currently use Ice 3.7.2 and my C++ DLL provided to Icebox woks perfectly within IceGridNode integration.
I followed your documentation instruction for manually deployed service and the IceBox Windows Service can be activated with the correct path and correct config file. The Ice::Service::start() method is invoked and runs fine until the end as my logging shows. Nevertheless the Windows Service MessageBox's progress bar popping up at startup hangs for 30sec and terminates with the following error in the Event Log:
Event ID 7009 : A timeout was reached (30000 milliseconds) while waiting for the ServiceName Local service to connect.
Event ID 7000 : The_ServiceName_ service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.
As a consequence Windows terminates the Icebox without calling the Ice::Service:stop() method.
If I run in a command prompt the command line passed to Windows Service configuration, there is no issue and all features works fine.
So what do I do wrong ? It looks like Windows is awaiting some acknowledgement from Icebox after the start() succeed to flag it as started. Isn't Icebox supposed to do that ? Do I have to use some specific option on the command line or in the config file to inform Icebox that it runs as a Windows service ?
Thanks a lot in advance for your help,
I tested this with the IceBox/demo from Ice 3.7.4 and the instructions from https://doc.zeroc.com/ice/3.7/platform-specific-features/windows-services/manually-installing-a-service-as-a-windows-service. I didn't find any issues.
Seems your service is being killed because it takes more than 30 seconds to start, you can add some tracing to your service start to see what's going on, you can also try to increase the start timeout and attach the debugger to the IceBox process to see what is happening.
Regarding increasing the service start timeout see: https://support.microsoft.com/en-us/help/922918/a-service-does-not-start-and-events-7000-and-7011-are-logged-in-window0
Hi José and thanks for the fast feedback,
Thanks also for the link, I've seen it during my troubleshooting before posting here.
For me service start completed when the implementation of Ice::Service::start() completes. I do print on the standard output at the end and it takes only a few millisec as expected. Is there another step to complete to consider the service started from the Icebox point of view ?
After starting the configured services, it activates the service manager adapter if "IceBox.ServiceManager.Endpoints" was set, and then prints ready message if "IceBox.PrintServicesReady" was set, once that is done it return control to Ice::Service class that will notify Windows that the service was started.
Did you check icebox.exe is run with
sc qc icebox [SC] QueryServiceConfig SUCCESS SERVICE_NAME: icebox TYPE : 10 WIN32_OWN_PROCESS START_TYPE : 2 AUTO_START ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : C:\Program Files\ZeroC\Ice-3.7.4\bin\icebox.exe --Ice.Config=D:\3.7.4\ice-demos\cpp98\IceBox\hello\config.icebox --service icebox LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : IceBox Server DEPENDENCIES : SERVICE_START_NAME : NT Authority\LocalService
BINARY_PATH_NAMEand make sure
--serviceargument is there
Also try setting
IceBox.PrintServicesReadyand see if the ready message is in the log, this will indicate that IceBox start correctly.5
You've spotted the issue !!!!
It works fine now. I did try the --service but misunderstood it how to correctly make use of it.
That is a very efficient support and many thanks for it.