net/vnstat: enable auto-respawn when vnstatd crashes
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 23 Jul 2017 10:01:10 +0000 (12:01 +0200)
committerMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Thu, 31 May 2018 11:03:38 +0000 (13:03 +0200)
commit96ae89c8014e6bfff61797c031f8c8e7f45b98f8
treebd46c841cb27e96a879968f79f1e7906aa2c6093
parente1acbd55b6e7bb479d1a1c36c0d9b19feb61b668
net/vnstat: enable auto-respawn when vnstatd crashes

Originally this was indended as a fix for devices without RTC support
which do not have the correct time set after a reboot (until ntp is able
to update the system time). vnstat checks if there is a time difference
between the latest entry in the database and detects that the system time
is incorrect. In this case vnstat does not start (to prevent database
corruption), the following message is reported instead:
'Error: Interface "..." has previous update date too much in the future,
exiting.'
Once we have network connectivity (and ntp has updated the system time)
vnstat starts correctly though.
vnstat 1.18 fixes this by waiting a few minutes (instead of exiting) and
the following message is logged:
"Latest database update is in the future (db: 2018-04-28 08:39:11 > now:
2018-04-28 08:07:18). Giving the system clock up to 5 minutes to sync
before continuing."

This still adds a procd respawn trigger to let procd automatically
restart vnstat in case:
- vnstat it crashes
- no valid system time is received for a long time (no network
  connectivity, broken NTP servers, ...)

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
net/vnstat/Makefile
net/vnstat/files/vnstat.init