From 2b014c3067e7a12d6d04cb6af48ba9c2ffbfa2bd Mon Sep 17 00:00:00 2001 From: linggao Date: Fri, 30 May 2008 03:05:38 +0000 Subject: [PATCH] bug fix in monitoring infrastructure git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1528 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../lib/xcat/monitoring/monitorctrl.pm | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/monitoring/monitorctrl.pm b/xCAT-server-2.0/lib/xcat/monitoring/monitorctrl.pm index 8766e90df..fceae58a1 100644 --- a/xCAT-server-2.0/lib/xcat/monitoring/monitorctrl.pm +++ b/xCAT-server-2.0/lib/xcat/monitoring/monitorctrl.pm @@ -97,11 +97,13 @@ sub start { } } - if (keys(%PRODUCT_LIST) > 0) { - regNodelistNotif(); - } - else { - unregNodelistNotif(); + if (! xCAT::Utils->isServiceNode()) { + if (keys(%PRODUCT_LIST) > 0) { + regNodelistNotif(); + } + else { + unregNodelistNotif(); + } } #print "child done\n"; @@ -133,7 +135,6 @@ sub regNodelistNotif { } $tab->close(); } - if (!$regged) { xCAT_plugin::notification::regNotification([qw(monitorctrl.pm nodelist -o a,d)]); } @@ -178,7 +179,7 @@ sub unregNodelistNotif { =cut #------------------------------------------------------------------------------- sub handleMonSignal { - #print "handleMonSignal called masterpid=$masterpid\n"; + #print "monitorctrl handleMonSignal called masterpid=$masterpid\n"; #save the old cache values my @old_products=keys(%PRODUCT_LIST); my $old_nodestatmon=$NODESTAT_MON_NAME; @@ -226,14 +227,15 @@ sub handleMonSignal { #registers or unregusters this module in the notification table for changes in # the nodelist and monitoring tables. - if (keys(%PRODUCT_LIST) > 0) { - regNodelistNotif(); - } - else { - unregNodelistNotif(); + if (! xCAT::Utils->isServiceNode()) { + if (keys(%PRODUCT_LIST) > 0) { + regNodelistNotif(); + } + else { + unregNodelistNotif(); + } } - #setup the signal again $SIG{USR2}=\&handleMonSignal; @@ -256,7 +258,7 @@ sub handleMonSignal { =cut #------------------------------------------------------------------------------- sub sendMonSignal { - #print "sendMonSignal masterpid=$masterpid\n"; + #print "monitorctrl sendMonSignal masterpid=$masterpid\n"; if ($masterpid) { kill('USR2', $masterpid); } else { @@ -293,7 +295,9 @@ sub stop { } xCAT_monitoring::montbhandler->unregMonitoringNotif(); - unregNodelistNotif(); + if (! xCAT::Utils->isServiceNode()) { + unregNodelistNotif(); + } if (%ret) { foreach(keys(%ret)) {