From 5b00b82065af2dd87facc881f6a430b0050dfc3f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 3 Dec 2012 10:13:02 -0800 Subject: [PATCH] Ignore INTERROGATE control. NSSM periodically logs that it received an unhandled INTERROGATE control. The control is sent by the system to request an update of the service's status but NSSM always keeps the status up-to-date so no action is needed on receipt of the control. Rather than fill the logs with instances of such a message, NSSM will now simply ignore the INTERROGATE control silently. --- ChangeLog.txt | 4 ++++ service.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 26ed909..525a3d8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +Changes since 2.16 +----------------- + * Silently ignore INTERROGATE control. + Changes since 2.15 ----------------- * Fixed case where NSSM could kill unrelated processes when diff --git a/service.cpp b/service.cpp index 81e46ef..d4d023b 100644 --- a/service.cpp +++ b/service.cpp @@ -319,6 +319,10 @@ void log_service_control(char *service_name, unsigned long control, bool handled /* Service control handler */ unsigned long WINAPI service_control_handler(unsigned long control, unsigned long event, void *data, void *context) { switch (control) { + case SERVICE_CONTROL_INTERROGATE: + /* We always keep the service status up-to-date so this is a no-op. */ + return NO_ERROR; + case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_STOP: log_service_control(service_name, control, true); -- 2.7.4