vnstat: made default database storage volatile

The service is storing the data in an interval to the emmc. This
forces to damage our emmc in the test devices earlier as wihtout.
Therefore the default location is on a ramdisk. For our test
purpose this is sufficient. And if it need to be persisted a RTD
section is created about how to do it.

BugzID: 63636

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-03-24 11:36:03 +01:00
parent 9d7b0f0ee5
commit ba2cc701e0
1 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,18 @@ inherit autotools pkgconfig systemd
EXTRA_OECONF = "--disable-extra-paths" EXTRA_OECONF = "--disable-extra-paths"
do_configure_append() {
# enable a volatile and persistent path for reading and writing the data base:
sed -i 's|ReadWritePaths=\/var\/lib|ReadWritePaths=\/var\/lib \/run\/|g' ${S}/examples/systemd/vnstat.service
# adapt the default config running in volatile mode
sed -i 's|DatabaseDir \"\/var\/lib\/vnstat\"|DatabaseDir \"\/run\/vnstat\"|g' ${S}/cfg/vnstat.conf
# add wwan0 as default interface
sed -i 's|Interface \"\"|Interface \"wwan0\"|g' ${S}/cfg/vnstat.conf
}
do_install_append() { do_install_append() {
install -Dm644 ${S}/examples/systemd/vnstat.service "${D}${systemd_system_unitdir}/vnstat.service" install -Dm644 ${S}/examples/systemd/vnstat.service "${D}${systemd_system_unitdir}/vnstat.service"
} }