[Linux-ha-dev] [PATCH][STABLE_1_2_3] heartbeat/hb_api.c is too verbose

Roberto Nibali ratz at drugphish.ch
Tue Dec 14 08:20:34 MST 2004


Hi,

We use a realtime ;) cluster status display for PS1. It's rather handy 
and something we used in our HA software for a while. It roughly works 
as follows:

CL_STATUS=/usr/opt/heartbeat/bin/cl_status
PS1=`echo "\h-\`${CL_STATUS} nodestatus \\\`uname -n\\\` 2>/dev/null || 
echo dead\`-\`${CL_STATUS} rscstatus 2>/dev/null || echo unknown\`:\`pwd 
-P\` # ";`

Of course it calls cl_status twice for every newline in the shell and as 
you probably know, this generates a couple of logfile entries every 
time. These look similar to those:

heartbeat: 2004/12/03_11:24:51 info: EOF from client pid 24105
heartbeat: 2004/12/03_11:24:51 info: Client pid 24105 died (input)
heartbeat: 2004/12/03_11:24:51 info: api_send_client: client 24105 died
heartbeat: 2004/12/03_11:24:51 info: Client pid 24111 died (input)
heartbeat: 2004/12/03_11:24:51 info: EOF from client pid 24111
heartbeat: 2004/12/03_11:24:51 info: Client pid 24111 died (input)
heartbeat: 2004/12/03_11:24:51 info: api_send_client: client 24111 died
heartbeat: 2004/12/03_11:24:51 info: Client pid 24113 died (input)
heartbeat: 2004/12/03_11:24:51 info: EOF from client pid 24113
heartbeat: 2004/12/03_11:24:51 info: Client pid 24113 died (input)
heartbeat: 2004/12/03_11:24:51 info: api_send_client: client 24113 died

To be honest, these lines contain no informational value whatsoever so 
I'd suggest to move those out into ha_debug or LOG_DEBUG.

Index: heartbeat/hb_api.c
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_api.c,v
retrieving revision 1.94.2.3
diff -u -r1.94.2.3 hb_api.c
--- heartbeat/hb_api.c  11 Sep 2004 20:52:32 -0000      1.94.2.3
+++ heartbeat/hb_api.c  14 Dec 2004 15:17:14 -0000
@@ -1064,7 +1064,7 @@
         }

         if (CL_KILL(client->pid, client->signal) < 0 && errno == ESRCH) {
-               cl_log(LOG_INFO, "api_send_client: client %ld died"
+               cl_log(LOG_DEBUG, "api_send_client: client %ld died"
                 ,       (long) client->pid);
                 if (!client->removereason) {
                         client->removereason = "died";
@@ -1441,7 +1441,7 @@

                 /* EOF? */
                 if (client->chan->ch_status == IPC_DISCONNECT) {
-                       cl_log(LOG_INFO
+                       cl_log(LOG_DEBUG
                         ,       "EOF from client pid %ld"
                         ,       (long)client->pid);
                         client->removereason = "EOF";
@@ -1485,7 +1485,7 @@
         /* May have gotten a message from 'client' */
         if (CL_KILL(client->pid, 0) < 0 && errno == ESRCH) {
                 /* Oops... he's dead */
-               cl_log(LOG_INFO
+               cl_log(LOG_DEBUG
                 ,       "Client pid %ld died (input)"
                 ,       (long)client->pid);
                 client->removereason = "died";

Please consider applying,
Roberto Nibali, ratz
-- 
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


More information about the Linux-HA-Dev mailing list