luci-app-statistics: Add backup/restore for RRD statistics 6646/head
authorJohn Kohl <jtk.git@bostonpog.org>
Wed, 25 Oct 2023 02:12:19 +0000 (22:12 -0400)
committerJohn Kohl <jtk.git@bostonpog.org>
Sun, 29 Oct 2023 23:48:38 +0000 (19:48 -0400)
commitad98af3a2be6c87b1f36cec05c8c3529831b7787
tree110897d0721a8c52855b6b56ac3e4df971914b4d
parenteabf1d020fad5f866ea6742c02fc808d0c43b349
luci-app-statistics: Add backup/restore for RRD statistics

Add a backup/restore capability for rrd data storage in
luci_statistics.  The data storage is typically in /tmp and does not
survive reboot or sysupgrade.  This adds an option for the
administrator to configure the RRD plugin, so that the RRD data are
are preserved with a backup copy in the overlay file system.

This works for shutdown/reboot, sysupgrade (backup config files,
restore config files, and true sysupgrade).

Also fix a bug where starting luci_statistics for the first time would
not get a restart a running collectd: during install of the package
when it is not included in the base flashed image, collectd might be
started when it got installed/configured before this package gets
installed/configured.  So we need to check if it's running, and
restart it to use the luci_statistics configuration.

Signed-off-by: John Kohl <jtk.git@bostonpog.org>
applications/luci-app-statistics/README.md [new file with mode: 0644]
applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/rrdtool.js
applications/luci-app-statistics/root/etc/init.d/luci_statistics
applications/luci-app-statistics/root/etc/luci_statistics/README.backups [new file with mode: 0644]
applications/luci-app-statistics/root/lib/upgrade/luci_statistics-add-conffiles.sh [new file with mode: 0755]