Skip to content

Commit

Permalink
wait for coredump
Browse files Browse the repository at this point in the history
  • Loading branch information
jredbeard committed Apr 27, 2017
1 parent dfccd3b commit a3b5dfd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions contrib/paas-sv-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ fi
# if the writer node dies, kill runsv causing the container to exit
STEEMD_PID=`pgrep -f p2p-endpoint`
if [[ ! $? -eq 0 ]]; then
echo NOTIFYALERT! steemd has quit unexpectedly, checking for core dump and then starting a new instance..
sleep 20
if [[ -e /tmp/core ]]; then
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" /usr/local/steemd-full/bin/steemd /tmp/core >> /tmp/stacktrace
STACKTRACE=`cat /tmp/stacktrace`
echo NOTIFYALERT! steemd stacktrace from coredump: $STACKTRACE
fi
echo NOTIFYALERT! steemd has quit unexpectedly, waiting for core dump and then starting a new instance..
while [ ! -e /tmp/core ]; do sleep 0.1; done
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" /usr/local/steemd-full/bin/steemd /tmp/core >> /tmp/stacktrace
STACKTRACE=`cat /tmp/stacktrace`
echo NOTIFYALERT! steemdsync stacktrace from coredump: $STACKTRACE
RUN_SV_PID=`pgrep -f /etc/service/steemd`
kill -9 $RUN_SV_PID
fi
Expand Down
12 changes: 5 additions & 7 deletions contrib/sync-sv-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ VERSION=`cat /etc/steemdversion`
# if the writer node dies by itself, kill runsv causing the container to exit
STEEMD_PID=`pgrep -f p2p-endpoint`
if [[ ! $? -eq 0 ]]; then
echo NOTIFYALERT! steemdsync has quit unexpectedly, checking for coredump and then starting a new instance..
sleep 20
if [[ -e /tmp/core ]]; then
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" /usr/local/steemd-full/bin/steemd /tmp/core >> /tmp/stacktrace
STACKTRACE=`cat /tmp/stacktrace`
echo NOTIFYALERT! steemdsync stacktrace from coredump: $STACKTRACE
fi
echo NOTIFYALERT! steemdsync has quit unexpectedly, waiting for coredump and then starting a new instance..
while [ ! -e /tmp/core ]; do sleep 0.1; done
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" /usr/local/steemd-full/bin/steemd /tmp/core >> /tmp/stacktrace
STACKTRACE=`cat /tmp/stacktrace`
echo NOTIFYALERT! steemdsync stacktrace from coredump: $STACKTRACE
RUN_SV_PID=`pgrep -f /etc/service/steemd`
kill -9 $RUN_SV_PID
fi
Expand Down

0 comments on commit a3b5dfd

Please sign in to comment.