This issue seems to be widely discussed, but I have problems with finding the solution in my particular case.
My service is set up to be running under Local System
account. On my first machine with Windows 7 SP1 (64-bit) installed, everything works as expected. But, just after I try to start the service on my second machine with Windows Server 2008 R2 SP1 (64-bit), not even a second passes, and I'm facing this annoying error:
Windows could not start the ProService service on Local Computer
Error 1053: The service did not respond to the start or control request in a timely fashion
The System Log
shows 2 entries:
The ProService service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.
and:
A timeout was reached (30000 milliseconds) while waiting for the ProService service to connect.
The implementation looks following:
Program.cs:
static void Main()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
ServiceBase.Run(new ServiceBase[] { new ProService() });
}
static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
if (e != null && e.ExceptionObject != null)
{
Logger.Record(e.ExceptionObject);
}
}
ProService.cs:
public ProService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
try
{
RequestAdditionalTime(10000);
FireStarter.Instance.Execute();
}
catch (Exception e)
{
Logger.Record(e);
throw;
}
}
The OnStart
method is just starting a new thread, so it takes almost NO time load to execute. I used RequestAdditionalTime
statement just in case - to reject this matter as a source of my problem. In addition, as you can see, I'm handling all of the exceptions, but no exception is written to my custom service event log during the startup (btw: logging is working on the first win7 machine). How to investigate what's going on ?
FireStarter.Instance.Execute()
? Can you post some code for that method? – FaginFireStarter.Instance.Execute()
containsvar thread = new Thread(x => WatchThread(new ThreadStart(ExecuteInternal))); thread.Start();
Framework is installed, the same on both machines. Unfortunately I've empty output infuslogsw
window (I accomplished all steps from this source: neovolve.com/post/2010/05/28/… and then attempt to start my service). – Auld