luci-app-statistics: Add backup/restore for RRD statistics
authorJohn Kohl <jtk.git@bostonpog.org>
Sat, 11 Nov 2023 11:15:16 +0000 (13:15 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Sat, 11 Nov 2023 11:15:16 +0000 (13:15 +0200)
commit6f95e78d9e4e5cc4cfaa4ffc0b4b50d3e35e9915
treef9917874b4f302e6584c3881a05693c91f2713cf
parent648ceed30781ea6a5e76d16b6e2b880dbe74935c
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>
(cherry picked from commit ad98af3a2be6c87b1f36cec05c8c3529831b7787)
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]