Skip to content

Commit 0d3c11e

Browse files
authored
add some logs
1 parent 4f753a5 commit 0d3c11e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

guard.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,13 @@ COPY_TOWER(){ # copy tower file from PRIMARY to SECONDARY
515515

516516

517517
RELAYER_SERVICE_NAME="relayer.service"
518-
RELAYER_ERRORS="aoi updates disconnected|block engine failed|error authenticating and connecting|BlockEngineFailure"
518+
RELAYER_ERRORS="error authenticating and connecting|BlockEngineFailure"
519519
CHECK_RELAYER(){ # check relayer service on current server
520520
if [[ $RELAYER_SERVICE == 'true' ]]; then
521521
if systemctl is-active --quiet "$RELAYER_SERVICE_NAME"; then
522-
LOG "Relayer is active"
523522
MATCHES=$(journalctl -u "$RELAYER_SERVICE_NAME" --since "3 seconds ago" | grep -E "$RELAYER_ERRORS")
524523
if [[ -n "$MATCHES" ]]; then
525-
LOG "Detected relayer conflict: $MATCHES"
524+
LOG "Error: Detected relayer conflict"
526525
fi
527526
else
528527
LOG "Relayer inactive! try to restart it"
@@ -553,7 +552,13 @@ PRIMARY_SERVER(){ ##############################################################
553552
SECONDARY_SERVER(){ ##################################################################
554553
SEND_INFO "SECONDARY ${NODE}.${NAME} $CUR_IP start"
555554
if [[ $RELAYER_SERVICE == 'true' ]] && systemctl is-active --quiet "$RELAYER_SERVICE_NAME"; then
555+
LOG "Relayer is active! try to stop it"
556556
systemctl stop "$RELAYER_SERVICE_NAME"
557+
if [[ $? -eq 0 ]]; then
558+
LOG "Relayer stoped successfully"
559+
else
560+
LOG "Error: Relayer stop failed"
561+
fi
557562
fi
558563
# waiting remote server fail and selfcheck health
559564
set_primary=0 #

0 commit comments

Comments
 (0)