Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332429 - net-analyzer/vnstat: /etc/init.d/vnstatd does not cope with /var/run being emptied on reboot
Summary: net-analyzer/vnstat: /etc/init.d/vnstatd does not cope with /var/run being em...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-12 14:14 UTC by Xake
Modified: 2011-09-04 17:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
vnstatd.initd-r1 (vnstatd,1018 bytes, text/plain)
2010-10-22 19:51 UTC, i.Dark_Templar
Details
vnstatd.initd-r2 (vnstatd,1.01 KB, text/plain)
2010-10-22 19:58 UTC, i.Dark_Templar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xake 2010-08-12 14:14:28 UTC
this is a follow up on bug #332397

Summary from of my problem from that bug is that it seems that the ebuild for vnstatd creates /var/run/vnstatd and chown it to
vnstat:vnstat. Then start-stop-daemon starts vnstatd creating and placing a
vnstatd.pid in that directory with chuid vnstat:vnstat.
This works fine as long as /var/run is an permanent filesystem.
However if /var/run is mounted tmpfs the directory gets wiped evey reboot
resulting in /var/run/vnstatd being non-existing on the next reboot."

Jeremy pointed out that this is a bug in the initscript for vnstatd, and told me to open this bug. Suggested fixes was to have the init script create the directory or use /var/run directly.
Comment 1 i.Dark_Templar 2010-10-22 19:51:56 UTC
Created attachment 251631 [details]
vnstatd.initd-r1

I've got same bug, so i've written a patched init script. There is it's diff:

--- vnstatd     2010-10-22 23:46:32.000000000 +0400
+++ /etc/init.d/vnstatd 2010-10-22 23:48:21.000000000 +0400
@@ -13,6 +13,7 @@
 
 start() {
        ebegin "Starting vnstatd"
+       checkpath -q -d -m 755 -o vnstat:vnstat /var/run/vnstatd
        start-stop-daemon --start --quiet \
                --pidfile "${VNSTATD_PIDFILE}" \
                --chuid vnstat:vnstat \
Comment 2 i.Dark_Templar 2010-10-22 19:58:26 UTC
Created attachment 251633 [details]
vnstatd.initd-r2

This is second version of init script for vnstatd. It get's dirname of pidfile, but it adds dependency on program "dirname" from coreutils. Diff with current gentoo script:

--- vnstatd     2010-10-22 23:46:32.000000000 +0400
+++ /etc/init.d/vnstatd 2010-10-22 23:56:14.000000000 +0400
@@ -13,6 +13,7 @@
 
 start() {
        ebegin "Starting vnstatd"
+       checkpath -q -d -m 755 -o vnstat:vnstat `dirname ${VNSTATD_PIDFILE}`
        start-stop-daemon --start --quiet \
                --pidfile "${VNSTATD_PIDFILE}" \
                --chuid vnstat:vnstat \
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2011-09-04 17:55:00 UTC
Fixed. Thanks for reporting and for the patch.