| Summary: | net-analyzer/vnstat-1.4 version bump (cp) | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Daniel Webert <rockoo> |
| Component: | New packages | Assignee: | 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
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 Created attachment 32081 [details]
vnstat-1.4.ebuild
a copyquick of last ebuild works fine overhere (x86) - attached ebuild - please bump 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> 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> 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.
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. |