Skip to content

Commit 47f14a3

Browse files
committed
Drop legacy second-mlat.sh helper script
Inherited from wiedehopf/adsb-scripts in 2021. The script generated an airplanes-mlat2 systemd unit running a second mlat-client, but nothing invoked it from install/update/configure, the hostname was hardcoded so it was only useful after manual editing, and it was never documented or tested. update.sh now sweeps the stale copy off upgraded installs; uninstall.sh still cleans up airplanes-mlat2 for operators who manually ran the helper.
1 parent 0ac226c commit 47f14a3

3 files changed

Lines changed: 14 additions & 50 deletions

File tree

scripts/second-mlat.sh

Lines changed: 0 additions & 48 deletions
This file was deleted.

test/image-rootfs-smoke.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ chmod +x "$ROOT_DIR/usr/bin/airplanes-feeder"
8484
IPATH="$ROOT_DIR/usr/local/share/airplanes"
8585
mkdir -p "$IPATH/venv/bin"
8686
cp "$FEED_REPO/update.sh" "$IPATH/update.sh"
87+
# Simulate an upgraded install that still has the legacy second-mlat.sh
88+
# helper left over from an older feed release; update.sh must sweep it
89+
# regardless of whether the new tree carries the file or not. The post-update
90+
# `test ! -e "$IPATH/second-mlat.sh"` below guards the sweep.
91+
printf '#!/bin/bash\nexit 0\n' > "$IPATH/second-mlat.sh"
92+
chmod +x "$IPATH/second-mlat.sh"
8793
cat > "$IPATH/venv/bin/mlat-client" <<'SH'
8894
#!/usr/bin/env bash
8995
exit 0
@@ -177,6 +183,7 @@ test -x "$ROOT_DIR/usr/local/bin/apl-feed"
177183
test -f "$IPATH/apl-feed/common.sh"
178184
test -f "$IPATH/airplanes-feed.sh"
179185
test -f "$IPATH/airplanes-mlat.sh"
186+
test ! -e "$IPATH/second-mlat.sh"
180187
test -f "$ROOT_DIR/etc/systemd/system/airplanes-feed.service"
181188
test -f "$ROOT_DIR/etc/systemd/system/airplanes-mlat.service"
182189
test ! -e "$ROOT_DIR/lib/systemd/system/airplanes-feed.service"

update.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ fi
347347

348348
cp "$GIT/uninstall.sh" "$IPATH"
349349
cp "$GIT"/scripts/*.sh "$IPATH"
350+
# Sweep the now-removed second-mlat.sh helper from upgraded installs. The
351+
# wildcard cp above only adds files that exist in scripts/; it does not
352+
# clean up files that used to ship there. See the airplanes-mlat2 cleanup
353+
# in uninstall.sh for the matching service-side handling.
354+
rm -f "$IPATH/second-mlat.sh"
350355
install -d -m 0755 "$IPATH/apl-feed"
351356
install -m 0644 "$GIT"/scripts/apl-feed/*.sh "$IPATH/apl-feed"
352357
mkdir -p "$LOCAL_BIN"
@@ -356,8 +361,8 @@ install -m 0755 "$GIT/scripts/apl-feed.sh" "$LOCAL_BIN/apl-feed"
356361
# users typically pick as their console/SSH login on a fresh image flash.
357362
# Existing installs keep their orphan "airplanes" user in /etc/passwd;
358363
# deleting it would risk breaking unknown local references (custom drop-ins,
359-
# an airplanes-mlat2.service generated by an older second-mlat.sh that still
360-
# pins User=airplanes, etc.).
364+
# an airplanes-mlat2.service generated by the now-removed legacy
365+
# second-mlat.sh that still pins User=airplanes, etc.).
361366
#
362367
# A private airplanes-feed group is created so other service accounts can
363368
# read claim-state files (mode 0640) without escalating to root. Membership

0 commit comments

Comments
 (0)