On Fri, Feb 29, 2008 at 09:51:46AM +0100, Ludovic Drolez wrote: > On Thu, Feb 28, 2008 at 10:17:43AM -0700, Kimball Larsen wrote: > > but the images appear as busted images on the status page. > > (With the patch :-D ) > > Hi ! > > This new patch should fix this bug. Anyway the graphs will appear > after "backuppc nightly" has run. > > I've also fixed another problem, which comes from the fact that I assumed > that the CGI was index.cgi (only true for Debian users ?).
Even with the newest patch, I still got broken images. There are two ways to run BackupPC_Admin. If you choose to run with BackupPC_Admin as a suid script rather than under a separate apache instance, you need the three lines below marked ### SUID added to the patch to Generalinfo.pm. This runs the rrdtool command as the user BackupPC runs as rather than as the apache user: diff -ur BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm --- BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm 2007-11-26 03:00:07.000000000 +0000 +++ BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm 2008-03-02 01:35:33.000000000 +0000 @@ -43,6 +43,16 @@ { GetStatusInfo("info jobs hosts queueLen"); my $Privileged = CheckPermission(); + if ($In{image} ne "") { + $In{image} =~ /([0-9]+)/; + my $weeks = $1; + my $real = $<; ### SUID + $< = $>; ### SUID + print "Content-type: image/png\n\n"; + print `/tools/rrdtool/bin/rrdtool graph - --imgformat=PNG --start=end-${weeks}w --end=-300 --title="BackupPC Pool Size" --base=1000 --height=100 --width=600 --alt-autoscale-max --lower-limit=0 --vertical-label="" --slope-mode --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8: -c BACK#FFFFFF DEF:ao="$LogDir/pool.rrd":ckb:AVERAGE CDEF:a=ao,1024,* AREA:a#95B8DB:"CPool in bytes" GPRINT:a:LAST:"Current\\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\\:%8.2lf %s" GPRINT:a:MAX:"Maximum\\:%8.2lf %s\\n"`; + $< = $real; ### SUID + return; + } my($jobStr, $statusStr); foreach my $host ( sort(keys(%Jobs)) ) { Note this patch includes a change in the path to rrdtool for my local site, so I would manually apply the three lines and not attempt to use patch(1). The other rrdtool calls are all called as the real BackupPC and not an effective user so it all works fine. -- -- rouilj John Rouillard System Administrator Renesys Corporation 603-244-9084 (cell) 603-643-9300 x 111 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/