From 4eacc008e33cf16c0616cf1b9b38c14fdfbd44fe Mon Sep 17 00:00:00 2001
From: Jarrod Johnson <jbjohnso@us.ibm.com>
Date: Tue, 25 Jun 2013 09:26:52 -0400
Subject: [PATCH 1/2] Fix problem where dbworkersocket rename could indicate a
 missing path

---
 perl-xCAT/xCAT/Table.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm
index 704fa18bf..549f6d637 100644
--- a/perl-xCAT/xCAT/Table.pm
+++ b/perl-xCAT/xCAT/Table.pm
@@ -159,7 +159,7 @@ sub init_dbworker {
         #This process is the database worker, it's job is to manage database queries to reduce required handles and to permit cross-process caching
         $0 = "xcatd: DB Access";
         use File::Path;
-        mkpath('/tmp/xcat/');
+        mkpath('/var/run/xcat/');
         use IO::Socket;
         $SIG{TERM} = $SIG{INT} = sub {
             $exitdbthread=1;

From 85237d5126df391d81b30917c3e4229c62472fcd Mon Sep 17 00:00:00 2001
From: Jarrod Johnson <jbjohnso@us.ibm.com>
Date: Wed, 26 Jun 2013 10:32:07 -0400
Subject: [PATCH 2/2] Fix problem where rvitals could request the same sensor
 multiple times

---
 xCAT-server/lib/xcat/plugins/ipmi.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm
index 2d8e03427..df56d80dd 100644
--- a/xCAT-server/lib/xcat/plugins/ipmi.pm
+++ b/xCAT-server/lib/xcat/plugins/ipmi.pm
@@ -4789,15 +4789,18 @@ sub vitals {
 	}
 
     $sessdata->{sensorstoread} = [];
+    my %usedkeys;
 	foreach(keys %sensor_filters) {
 		my $filter = $_;
         if ($filter eq "energy" or $filter eq "leds") { next; }
 
 		foreach $key (sort {$sdr_hash{$a}->id_string cmp $sdr_hash{$b}->id_string} keys %sdr_hash) {
+            if ($usedkeys{$key}) { next; } #avoid duplicate requests for sensor data
 			my $sdr = $sdr_hash{$key};
 			if(($doall and not $sdr->rec_type == 0x11 and not $sdr->sensor_type==0xed) or ($sdr->rec_type == 0x01 and $sdr->sensor_type == $filter)) {
 				my $lformat = $format;
                 push @{$sessdata->{sensorstoread}},$sdr;
+                $usedkeys{$key}=1;
             }
 		}
 	}