Re: [patch][4.0.0alpha3] switch to cmdSystemOrEvalLong in BackupPC_rrdUpdate
Craig Barratt <[email protected]> Mon, 9 Dec 2013 23:53:33 -0800
| Newsgroups | gmane.comp.sysutils.backup.backuppc.devel |
|---|---|
| Message-ID | <CADSzEFgLsO-i264ms6kbscec83g3LRx+7xe5tLTEsP1K6+m_ig@mail.gmail.com> |
Alexander, Thanks for the patches. Also, I didn't merge in your code (rrd_2_v4.pl) to upgrade any V3 rrd file. I wanted to do that without requiring the user to install RRD::Simple. However, I couldn't see how to do the conversion using the command-line rrdtool. Craig On Mon, Dec 9, 2013 at 11:38 PM, Alexander Moisseev <[email protected]>wrote: > 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 > > > ------------------------------------------------------------------------------ > Sponsored by Intel(R) XDK > Develop, test and display web and hybrid apps with a single code base. > Download it for free now! > > http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk > _______________________________________________ > BackupPC-devel mailing list > [email protected] > List: https://lists.sourceforge.net/lists/listinfo/backuppc-devel > Wiki: http://backuppc.wiki.sourceforge.net > Project: http://backuppc.sourceforge.net/ > ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ BackupPC-devel mailing list [email protected] List: https://lists.sourceforge.net/lists/listinfo/backuppc-devel Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/