Project

General

Profile

Actions

Feature #1788

closed

mod_rrdtool should init db if file is empty

Added by glen about 16 years ago. Updated almost 16 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_rrdtool
Target version:
ASK QUESTIONS IN Forums:

Description

for purpose of setting initial permissions from rpm package, there's such file installed to system:

-rw-r----- 1 lighttpd stats 0 2008-10-07 13:14 /var/lib/lighttpd/lighttpd.rrd

lighty won't run rrdtool create on this file, so the file stays empty. and when rrdtool graph is ran such error is output

ERROR: reading the cookie off /var/lib/lighttpd/lighttpd.rrd failed

suggestion: make lighttpd run rrdtool create when .rrd file is empty (st.st_size == 0).

tested and it would work:

# ls -l lighttpd.rrd
-rw-r----- 1 lighttpd stats 0 2008-10-07 13:14 lighttpd.rrd
# > lighttpd.rrd
# rrdtool create lighttpd.rrd --step 60  DS:InOctets:ABSOLUTE:600:U:U  DS:OutOctets:ABSOLUTE:600:U:U  DS:Requests:ABSOLUTE:600:U:U  RRA:AVERAGE:0.5:1:600  RRA:AVERAGE:0.5:6:700  RRA:AVERAGE:0.5:24:775  RRA:AVERAGE:0.5:288:797  RRA:MAX:0.5:1:600  RRA:MAX:0.5:6:700  RRA:MAX:0.5:24:775  RRA:MAX:0.5:288:797  RRA:MIN:0.5:1:600  RRA:MIN:0.5:6:700  RRA:MIN:0.5:24:775  RRA:MIN:0.5:288:797
# ls -l lighttpd.rrd
-rw-r----- 1 lighttpd stats 212040 2008-10-07 13:16 lighttpd.rrd

Files

lighttpd-mod_rrdtool-emptyfile.patch (2.91 KB) lighttpd-mod_rrdtool-emptyfile.patch proposed patch glen, 2008-10-07 10:34
Actions #1

Updated by stbuehler about 16 years ago

I don't see why there should be an empty file. Either create it with rrdtool or give lighty write permissions to the directory? (/var/lib/lighttpd looks like it should be writable by lighty)

And the next one probably wants "rrdtool create" for size == 2 ("\r\n") too...

Actions #2

Updated by glen about 16 years ago

  • Status changed from New to Assigned
Actions #3

Updated by glen about 16 years ago

reason: i want lighttpd:stats being ownership. if lighttpd creates the file, it would be lighttpd:lighttpd.

0 byte file with lighttpd:stats cames from rpm package as rpm install is run as root, which has possibility to change ownership, which lighttpd doesn't.

Actions #4

Updated by icy almost 16 years ago

  • Target version changed from 1.4.21 to 1.4.22
  • Patch available set to No
Actions #5

Updated by stbuehler almost 16 years ago

  • Target version changed from 1.4.22 to 1.4.23
Actions #6

Updated by glen almost 16 years ago

  • Patch available changed from No to Yes
Actions #7

Updated by glen almost 16 years ago

  • Status changed from Assigned to Fixed
  • % Done changed from 0 to 100

applied in r2418

Actions

Also available in: Atom