Skip to content

Commit

Permalink
napi: fix gw restart on crash
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed Oct 19, 2023
1 parent b2bd008 commit 1782852
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions notionalapi/gateway/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ EOT
########################################################################################################################
# run
cd $HOME
screen -S gateway -dm /root/go/bin/gateway start --conf=/root/gateway.yaml

cat <<EOT > $HOME/start.sh
while true; do /root/go/bin/gateway start --conf=/root/gateway.yaml; done
EOT

screen -S gateway -dm /bin/bash $HOME/start.sh

########################################################################################################################
# cron
Expand All @@ -56,8 +60,6 @@ random_minute=$(( ${RANDOM} % 60 ))

cat <<EOT > $HOME/restart_cronjob.sh
killall gateway
sleep 5
screen -S gateway -dm /root/go/bin/gateway start --conf=/root/gateway.yaml
EOT

echo "$random_minute $random_hour * * * root /bin/bash $HOME/restart_cronjob.sh" > /etc/cron.d/cron_restart_gateway
Expand Down

0 comments on commit 1782852

Please sign in to comment.