Skip to content

Commit

Permalink
adjust rarely used graphs1090 scripts for container (#213)
Browse files Browse the repository at this point in the history
changes systemctl to s6-svc commands
  • Loading branch information
wiedehopf authored Jul 28, 2024
1 parent 5bdcf9d commit 0e81721
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/scripts/graphs1090
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 7 additions & 4 deletions rootfs/etc/s6-overlay/startup.d/08-graphs1090-init
Original file line number Diff line number Diff line change
Expand Up @@ -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*<div class="column text-center">$/{$!{N;s/\(<div class="column text-center"\)\(>\n\s*<a id ="system-cpu-link"\)/\1 style="display:none"\2/;t;P;D}}' /usr/share/graphs1090/html/index.html
Expand Down Expand Up @@ -182,10 +189,6 @@ fi
if [[ -n "${GRAPHS1090_WWW_HEADER}" ]]; then
sed -i "s|WWW_HEADER=.*|WWW_HEADER=\"${GRAPHS1090_WWW_HEADER}\"|g" /etc/default/graphs1090
fi
if chk_enabled "${GRAPHS1090_HIDE_SYSTEM}" ; then
sed -i "s|HIDE_SYSTEM=.*|HIDE_SYSTEM=yes|g" /etc/default/graphs1090
fi


# Finally, add a link to graphs1090 to the tar1090 web page:
TAR1090_INDEX_HTML="/usr/local/share/tar1090/html-webroot/index.html"
Expand Down

0 comments on commit 0e81721

Please sign in to comment.