Alexander Moisseev
2013-12-10 07:38:59 UTC
Switch to cmdSystemOrEvalLong from cmdSystemOrEval when getting stdout because sub cmdSystemOrEval merges stdout and stderr together.
BackupPC_rrdUpdate creates broken images if HOME environment variable set to path non-readable by backuppc user (e.g. HOME=/root).
BackupPC_rrdUpdate writes stderr warnings in image files:
"(process:2430): Pango-WARNING **: error opening config file '/root/.config/pango/pangorc': Permission denied".
diff -ruN ./BackupPC_rrdUpdate.orig ./BackupPC_rrdUpdate
--- ./BackupPC_rrdUpdate.orig 2013-12-09 17:06:45.000000000 +0400
+++ ./BackupPC_rrdUpdate 2013-12-10 11:22:05.000000000 +0400
@@ -140,7 +140,7 @@
#
# Get each pool max value from RRD
#
- $bpc->cmdSystemOrEval(
+ $bpc->cmdSystemOrEvalLong(
[
$Conf{RrdToolPath},
"graphv", "-",
@@ -158,7 +158,7 @@
if ( $_[0] =~ /^print\[([0-3])\] = "([.0-9]+)"$/ ) {
$poolMax[$1] = $2 unless ( $2 == 0 );
}
- });
+ }, 0, undef);
my $poolSizeGraph = [
"$Conf{RrdToolPath}",
@@ -228,6 +228,6 @@
print("Can't open/create $LogDir/poolUsage$weeks.png\n");
return;
}
- $bpc->cmdSystemOrEval($poolSizeGraph, sub { print $fdOut $_[0] });
+ $bpc->cmdSystemOrEvalLong($poolSizeGraph, sub { print $fdOut $_[0] }, 1, undef);
close($fdOut);
}
--
Alexander
BackupPC_rrdUpdate creates broken images if HOME environment variable set to path non-readable by backuppc user (e.g. HOME=/root).
BackupPC_rrdUpdate writes stderr warnings in image files:
"(process:2430): Pango-WARNING **: error opening config file '/root/.config/pango/pangorc': Permission denied".
diff -ruN ./BackupPC_rrdUpdate.orig ./BackupPC_rrdUpdate
--- ./BackupPC_rrdUpdate.orig 2013-12-09 17:06:45.000000000 +0400
+++ ./BackupPC_rrdUpdate 2013-12-10 11:22:05.000000000 +0400
@@ -140,7 +140,7 @@
#
# Get each pool max value from RRD
#
- $bpc->cmdSystemOrEval(
+ $bpc->cmdSystemOrEvalLong(
[
$Conf{RrdToolPath},
"graphv", "-",
@@ -158,7 +158,7 @@
if ( $_[0] =~ /^print\[([0-3])\] = "([.0-9]+)"$/ ) {
$poolMax[$1] = $2 unless ( $2 == 0 );
}
- });
+ }, 0, undef);
my $poolSizeGraph = [
"$Conf{RrdToolPath}",
@@ -228,6 +228,6 @@
print("Can't open/create $LogDir/poolUsage$weeks.png\n");
return;
}
- $bpc->cmdSystemOrEval($poolSizeGraph, sub { print $fdOut $_[0] });
+ $bpc->cmdSystemOrEvalLong($poolSizeGraph, sub { print $fdOut $_[0] }, 1, undef);
close($fdOut);
}
--
Alexander