MINOR: server: do not emit warnings/logs/alerts on server state changes at boot
We'll have to use srv_set_admin_flag() to propagate some server flags
during the startup, and we don't want the resulting actions to cause
warnings, logs nor e-mail alerts to be generated since we're just applying
the config or a state file. So let's condition these notifications to the
fact that we're starting.
diff --git a/src/backend.c b/src/backend.c
index 573f054..176a10a 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1326,8 +1326,10 @@
be->last_change = now.tv_sec;
be->down_trans++;
- Alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id);
- send_log(be, LOG_EMERG, "%s %s has no server available!\n", proxy_type_str(be), be->id);
+ if (!(global.mode & MODE_STARTING)) {
+ Alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id);
+ send_log(be, LOG_EMERG, "%s %s has no server available!\n", proxy_type_str(be), be->id);
+ }
}
/* Apply RDP cookie persistence to the current stream. For this, the function