Reputation: 4001
This is the story of a windows service that has been running for years on multiple servers, but for one reason or another will not start on one specific 2012 Windows Server any longer. It worked fine on this server also until it suddenly did not (June 26th 2019).
The error message it gives is the generic Error 1053: The service did not respond to the start or control request in a timely fashion
. This could mean almost anything. I have followed advice from other SO questions:
ServicePipeTimeout
in Registry to several minutes and restarted the service. Note that the error message comes immediately when I try to start the service manually in the Services window, not after the expected time.Allow service to interact with desktop
for the Local Service as described here (as this fits my scenario except for that being a 2003 Server): Link to similar 2003 Server problemI can, however, double click the exe-file. This actually works as long as I don't close the command window that opens. In the Services window the windows service there is still not running, but now the program is running as long as I don't close the command window or the logged in session. This is of course not a good solution.
Here is the startup code, by the way:
using System;
using System.Diagnostics;
using Topshelf;
namespace Blabla.Endpoint
{
class Program
{
static void Main(string[] args)
{
try
{
HostFactory.Run(x =>
{
x.Service<EndpointConfiguration>(s =>
{
s.ConstructUsing(name => new EndpointConfiguration());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());
});
x.RunAsLocalSystem();
x.SetDescription("Handles events for Blabla.Endpoint");
x.SetDisplayName("Blabla.Endpoint");
x.SetServiceName("Blabla.Endpoint");
});
}
catch (Exception ex)
{
EventLog.WriteEntry("Application", ex.ToString(), EventLogEntryType.Error);
throw;
}
}
}
}
Any ideas what I should try next?
Update 1
I have not been able to research this as much as I would have liked to since the post, but I have found by looking more closely at the EventLog (thanks, @Rhizzakanizza) that the last thing that happened before the service stopped working was that the server was restarted by C:\WINDOWS\CCM\CcmExec.exe.
Google says: "The process ccmexec.exe (Microsoft SMS Agent Host ) is part of the Microsoft SMS (Systems Management Server) suite, which is mainly used to distribute software patches to the machines on a network." (reference link)
Is there anywhere to see what this might have installed around or just before June 26th 2019? There are no Windows Update patches around that date, but clearly the server was restarted by this process in conjunction with some update.
Upvotes: 0
Views: 429
Reputation: 39
Some thoughts,
Add a call to EventLog.WriteEntry();
as the first line in main. It's possible for some faults to bomb straight through a try-catch, although rare. Regardless, I think it'd be more definitive in showing that there's a new configuration issue.
Check the security logs for activity during service startup. There are some differences, but they key symptoms you are describing were the same as I encountered recently. That turned out to be the "log on as" settings I was trying to use. Just to note, I'm also using TopShelf.
Finally, how far back from June 26th have you looked in the logs? It may not be a Windows Update but maybe you can find some evidence of a configuration change. If you want to cast even a wider net, search the file system to see if you can identify any interesting changes based on modification times that might correlate to your symptoms.
Upvotes: 1