[PATCH 1/2] base/notifications: Do send notifications when services goes down

robin.sonefors at op5.com robin.sonefors at op5.com
Thu Nov 29 18:54:59 CET 2012


From: Robin Sonefors <robin.sonefors at op5.com>

So, this was a bit silly...

When checking a service alert's notification viability, we forgot
to check if the alert was about a recovery before ensuring that the
recovery was valid to send out. This means that people who've tried
upgrading have usually received some notifications - just enough not to
think too hard about it - and people who haven't have still received
other types of notifications.

Signed-off-by: Robin Sonefors <robin.sonefors at op5.com>
---
 base/notifications.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/notifications.c b/base/notifications.c
index dc3d93f..2991c28 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -514,7 +514,7 @@ int check_service_notification_viability(service *svc, int type, int options) {
 		log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't notify about %s states for this service.\n", service_state_name(svc->current_state));
 		return ERROR;
 		}
-	if(svc->notified_on == 0) {
+	if(svc->current_state == STATE_OK && svc->notified_on == 0) {
 		log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't notify about this recovery.\n");
 		return ERROR;
 		}
-- 
1.7.11.7


------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net




More information about the Developers mailing list