So the solution to this would to update the Debian package to use vnstat 2.1 (the update is detected by https://tracker.debian.org/pkg/vnstat). It would be nice to have this in Debian before the buster freeze, but https://release.debian.org/buster/freeze_policy.html states that
> Starting 2019-02-12, only *small, targeted fixes* are appropriate for buster > Please note that new transitions or large/disruptive changes are not appropriate. So given that the CLI interface seems to have changed between the 2 major versions I don't know if it would be accepted in buster before the freeze... Even though it fixes this bug... I'm CCing the maintainer as it would be nice to have an answer from his side. Thanks for your quick reply Le sam. 9 févr. 2019 à 22:35, Teemu Toivola <[email protected]> a écrit : > > On Sat, 9 Feb 2019 20:40:56 +0000 > nodiscc <[email protected]> wrote: > > > We had a discussion on IRC on how to best fix this. At first there was an > > attempt to use DaemonUser "vnstat" DaemonGroup "vnstat" and removing > > User=vnstat from the systemd unit file. But even then you have to > systemctl > > restart vnstat for it to fix the db file permissions. So also manual. > > For the 1.x versions, the intent was that using DaemonUser "vnstat" + > DaemonGroup "vnstat" and letting vnstatd start as root would fix the issue > as the daemon would correct possible file and directory permissions issues > by itself before switching to run as the configured user and group. There > would anyway need to be another command executed after "vnstat -u -i foo" > as the daemon doesn't automatically scan for new databases. The only thing > that it does is that it tracks those files that were present during startup > and if any gets removed then tracking of that interface is stopped. > > However, things change a little bit once the Debian package gets updated to > include some 2.x version. As a result, there will be only one database file > no matter how many interfaces are being tracked. That way, adding new > interfaces for tracking even with the wrong user will not result in file > permission issues with the database file. The '-u' parameter has been > replaced with '--add' in order to remove the previous double role of '-u' / > '--update'. This obviously also has the side effect of making some really > old instructions for using vnstat partially invalid. > > > I think a good and simple fix is to install the /var/lib/vnstat/ > directory > > with sgid bit set. That way any file created there would have correct > > permissions. > > See above. An upgrade to a 2.x version should solve the issue without > requiring sgid bit being set among other corrections and improvements as > documented in the CHANGES [1] file. > > [1] https://humdi.net/vnstat/CHANGES > > -- > - Teemu Toivola >

