-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement s6-overlay v3 * adjust healthcheck
- Loading branch information
Showing
21 changed files
with
93 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
exec /scripts/initialise.sh |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
exec /scripts/mlat-client.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
fdmove -c 2 1 /usr/local/sbin/pw-feeder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,66 @@ | ||
#!/usr/bin/with-contenv bash | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
# Import healthchecks-framework | ||
# shellcheck disable=SC1091 | ||
source /opt/healthchecks-framework/healthchecks.sh | ||
|
||
# Prepare EXITCODE variable | ||
EXITCODE=0 | ||
|
||
echo "Ensure connection to beast provider $BEASTHOST:$BEASTPORT" | ||
if ! check_tcp4_connection_established ANY ANY "$(get_ipv4 "$BEASTHOST")" "$BEASTPORT"; then | ||
# check pw-feeder to beasthost connection | ||
echo -n "pw-feeder connected to $BEASTHOST:$BEASTPORT: " | ||
if ! ss --tcp --processes state established dst "$BEASTHOST" \&\& dport "$BEASTPORT" | grep pw-feeder > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
PW_FEED_DESTINATION_BEAST_HOST=$(echo "${PW_BEAST_ENDPOINT}" | cut -d: -f1) | ||
PW_FEED_DESTINATION_BEAST_PORT=$(echo "${PW_BEAST_ENDPOINT}" | cut -d: -f2) | ||
|
||
echo "Ensure connection to plane.watch $PW_FEED_DESTINATION_BEAST_HOST:$PW_FEED_DESTINATION_BEAST_PORT" | ||
if ! check_tcp4_connection_established ANY ANY "$(get_ipv4 "$PW_FEED_DESTINATION_BEAST_HOST")" "$PW_FEED_DESTINATION_BEAST_PORT"; then | ||
# check pw-feeder to plane.watch BEAST connection | ||
echo -n "pw-feeder connected to $PW_BEAST_ENDPOINT: " | ||
if ! ss --tcp --processes state established dst "$PW_BEAST_ENDPOINT" | grep pw-feeder > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
echo "Check service death tally" | ||
if ! check_s6_service_abnormal_death_tally ALL; then | ||
EXITCODE=1 | ||
# if MLAT enabled... | ||
if [[ "${ENABLE_MLAT,,}" == "true" ]]; then | ||
|
||
# check mlat-client to beasthost connection | ||
echo -n "mlat-client connected to $BEASTHOST:$BEASTPORT: " | ||
if ! ss --tcp --processes state established dst "$BEASTHOST" \&\& dport "$BEASTPORT" | grep mlat-client > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
# check mlat-client to pw-feeder connection | ||
echo -n "mlat-client connected to pw-client ($MLATSERVERHOST:$MLATSERVERPORT): " | ||
if ! ss --tcp --processes state established dst "$MLATSERVERHOST" \&\& dport "$MLATSERVERPORT" | grep mlat-client > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
# check mlat-client to pw-feeder connection | ||
echo -n "pw-feeder connected to mlat-client: " | ||
if ! ss --tcp --processes state established src "$MLATSERVERHOST" \&\& sport "$MLATSERVERPORT" | grep pw-feeder > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
# check pw-feeder to plane.watch MLAT connection | ||
echo -n "pw-feeder connected to $PW_MLAT_ENDPOINT: " | ||
if ! ss --tcp --processes state established dst "$PW_MLAT_ENDPOINT" | grep pw-feeder > /dev/null 2>&1; then | ||
EXITCODE=1 | ||
echo "FAIL" | ||
else | ||
echo "OK" | ||
fi | ||
|
||
fi | ||
|
||
exit "$EXITCODE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
rootfs/etc/services.d/mlat-client/run → rootfs/scripts/mlat-client.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters