Skip to content

Commit

Permalink
move tar1090 files to /run/tar1090
Browse files Browse the repository at this point in the history
this way the service uses its own run directory instead of clashing with
readsb
for example when the readsb service is restarted its run directory is
cleared which means the accumulated tar1090 data is lost for no good
reason
this usually doesn't happen but this is still much nicer
  • Loading branch information
wiedehopf committed Nov 1, 2024
1 parent cdedc3f commit 096d338
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ RUN \
rm /etc/nginx/sites-enabled/default && \
# tar1090: install using project copy of original script
bash /app/rootfs/tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" && \
# change some /run/tar1090-webroot to /run/readsb to make work with existing docker scripting
sed -i -e 's#/run/tar1090-webroot/#/run/readsb/#' /usr/local/share/tar1090/nginx-tar1090-webroot.conf && \
# tar1090-db: document version
echo "tar1090-db $(cat ${TAR1090_UPDATE_DIR}/git-db/version)" >> VERSIONS && \
# tar1090: document version
Expand Down
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/tar1090/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
rm -rf /run/tar1090
6 changes: 3 additions & 3 deletions rootfs/etc/s6-overlay/scripts/tar1090
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ if chk_enabled "${TAR1090_DISABLE}"; then
stop_service
fi

mkdir -p /run/tar1090
rundir="/run/tar1090"
mkdir -p "$rundir"
sleep 5

# shellcheck source=/dev/null
#source "${TAR1090_INSTALL_DIR}/default"

srcdir=/run/readsb
service=readsb

exec s6wrap --quiet --prepend=tar1090 --timestamps --args bash /usr/local/share/tar1090/tar1090.sh \
"/run/$service" \
"$rundir" \
"$srcdir"

# "$INTERVAL" \
Expand Down
3 changes: 2 additions & 1 deletion rootfs/etc/s6-overlay/startup.d/04-tar1090-configure
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ else
fi

# Add in CORS header for tar1090 data/aircraft.json file
# adjust the tar1090 runtime directory to /run/tar1090

sed -i \
-e 's/location ~ aircraft\\.json$ {/location ~ aircraft\.json$ {\n add_header Access-Control-Allow-Origin "\*";/g' \
-e 's#/run/tar1090-webroot/#/run/readsb/#' \
-e 's#/run/tar1090-webroot/#/run/tar1090/#' \
"${TAR1090_INSTALL_DIR}/nginx-tar1090-webroot.conf"


Expand Down

0 comments on commit 096d338

Please sign in to comment.