From 0e81721647f22eb9f0e159e6806be55cf5fb11ec Mon Sep 17 00:00:00 2001 From: wiedehopf Date: Sun, 28 Jul 2024 09:27:55 +0200 Subject: [PATCH] adjust rarely used graphs1090 scripts for container (#213) changes systemctl to s6-svc commands --- Dockerfile | 2 ++ README.md | 2 +- rootfs/etc/s6-overlay/scripts/graphs1090 | 2 ++ rootfs/etc/s6-overlay/startup.d/08-graphs1090-init | 11 +++++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c431901..8d7c608 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,6 +96,8 @@ RUN \ /usr/share/graphs1090/git/*.sh \ /usr/share/graphs1090/ \ && \ + # adjust scripts using systemctl for container (only affects speciality scripts) + bash /usr/share/graphs1090/git/adjust-scripts-s6-sh && \ # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L147 cp -v \ /usr/share/graphs1090/git/malarky.conf \ diff --git a/README.md b/README.md index 785f1fa..fc3ce69 100644 --- a/README.md +++ b/README.md @@ -536,7 +536,7 @@ docker exec -it tar1090 /usr/local/bin/viewadsb --cpr-focus 3D3ED0 | `GRAPHS1090_DISABLE_CHART_DISK_BANDWIDTH` | Set to `true` to disable the GRAPHS1090 Disk Bandwidth chart | Unset | | `GRAPHS1090_WWW_TITLE` | Set title for the web page (displayed in the browser title or tab bar) | `graphs1090` | | `GRAPHS1090_WWW_HEADER` | Set header text for the web page | `Perf. Graphs` | -| `GRAPHS1090_HIDE_SYSTEM` | Hide the system graphs and don't render them (system data is still collected, this might be changed) | `no` | +| `GRAPHS1090_HIDE_SYSTEM` | Hide the system graphs and don't render them, don't collect system data | `no` | ### Enabling UAT data diff --git a/rootfs/etc/s6-overlay/scripts/graphs1090 b/rootfs/etc/s6-overlay/scripts/graphs1090 index 1741355..9163bfd 100755 --- a/rootfs/etc/s6-overlay/scripts/graphs1090 +++ b/rootfs/etc/s6-overlay/scripts/graphs1090 @@ -8,4 +8,6 @@ if chk_enabled "${GRAPHS1090_DISABLE}" || chk_enabled "${TAR1090_DISABLE}"; then exec sleep infinity fi +mkdir -p /run/graphs1090 + exec s6wrap --quiet --prepend=graphs1090 --timestamps --args bash /usr/share/graphs1090/service-graphs1090.sh diff --git a/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init b/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init index 127cf81..cea46f0 100755 --- a/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init +++ b/rootfs/etc/s6-overlay/startup.d/08-graphs1090-init @@ -13,6 +13,13 @@ if chk_enabled "${GRAPHS1090_DISABLE}"; then exit 0 fi +if chk_enabled "${GRAPHS1090_HIDE_SYSTEM}" ; then + sed -i "s|HIDE_SYSTEM=.*|HIDE_SYSTEM=yes|g" /etc/default/graphs1090 + cp /usr/share/graphs1090/git/hide_system-collectd.conf /etc/collectd/collectd.conf +else + cp /usr/share/graphs1090/git/collectd.conf /etc/collectd/collectd.conf +fi + # Disable a few graphs based on parameter settings: if chk_enabled "${GRAPHS1090_DISABLE_CHART_CPU}"; then sed -i '/^\s*
$/{$!{N;s/\(
\n\s*