Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 52102

Summary: net-analyzer/vnstat-1.4 version bump (cp)
Product: Gentoo Linux Reporter: Daniel Webert <rockoo>
Component: New packagesAssignee: Gentoo Netmon project <netmon>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: tst
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: vnstat-1.4.ebuild

Description Daniel Webert 2004-05-26 09:14:08 UTC
net-analyzer/vnstat-1.4 version bump
Comment 1 Daniel Webert 2004-05-26 09:26:31 UTC
can we add to the ebuild info-output something like 'howto to start and the crontab-entry'?

init new db:
vnstat -u -i eth0

crontab-entry:
0-55/5 *        * * *   root    if [ -x /usr/bin/vnstat ] && [ `ls /var/sp
ool/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi
Comment 2 Daniel Webert 2004-05-26 09:32:24 UTC
Created attachment 32081 [details]
vnstat-1.4.ebuild
Comment 3 Daniel Webert 2004-05-26 09:33:03 UTC
a copyquick of last ebuild works fine overhere (x86) - attached ebuild - please bump
Comment 4 Daniel Webert 2004-05-26 09:39:11 UTC
the ebuild info-output is no more need - vnstat gives a help message it self howto ...

<snip>
init new db:
vnstat -u -i eth0
</snap>
Comment 5 Daniel Webert 2004-05-26 09:45:56 UTC
in the v1.4 the dir for the db changed from /var/spool/ to /var/lib/ :( because  i'm just a lazy copy-ebuild-guy -> dont know to solve this :) 

<snip of Makefile>
install:
	@echo "Installing vnStat..."

	@if [ -d $(DESTDIR)/var/spool/vnstat ]; then echo "Moving old database(s) to new location..."; mv -f $(DESTDIR)/var/spool/vnstat $(DESTDIR)/var/lib/; fi
</snap>
Comment 6 Devon 2004-05-27 00:59:37 UTC
I installed vnstat-1.1 and ran it for about 7 minutes and got stats. I then installed the new vnstat-1.4 ebuild and noticed that /var/spool/vnstat/ was not moved to /var/lib/vnstat. This is because the src_install() part of the ebuild doesn't actually run the "make install" part and just moves things where needed. I supposed we could just add a "mv blah" line in the ebuild....

<Testing>

Okay. I changed the vnstat-1.4 ebuild to move the data. Here is what I did:

o changed "dodir /var/spool/vnstat" to "dodir /var/lib/vnstat"
o added the following to the ebuild after src_install().

pkg_postinst() {

        # Move data to new location
        mv -f /var/spool/vnstat/* /var/lib/vnstat && rmdir /var/spool/vnstat
        # einfo to inform user that db files moved.
        einfo "vnstat db files moved from /var/spool/vnstat to /var/lib/vnstat"
}

After that, when I run "vnstat", I get the following:

# vnstat
Trying to convert database "/var/lib/vnstat/eth0" (v2) to current db format
Converting to db v3...
Convertion done.
Database updated: Thu May 27 03:55:01 2004

I am going to leave it running overnight. 
Comment 7 Teemu Toivola 2004-05-27 06:00:17 UTC
This is a duplicate of bug #44679. Please search old bugs before posting a new ones. As far as I can say, I'd rather see the ebuild from #44679 in portage since it installs the cron, man page and ppp-script examples right.
Comment 8 Eldad Zack (RETIRED) gentoo-dev 2004-07-25 07:08:15 UTC

*** This bug has been marked as a duplicate of 44679 ***