Skip to content

Commit

Permalink
add trap to catch SIGTERM and forward it to bee process
Browse files Browse the repository at this point in the history
  • Loading branch information
vandot committed Jun 8, 2020
1 parent dee73e1 commit b43707e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions charts/bee/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ spec:
- bash
- -ac
- >
pid=;
trap '[[ $pid ]] && kill "$pid"' SIGTERM;
if [ $(echo $(hostname) | rev | cut -d'-' -f 1 | rev) == 0 ]; then
bee start --config=.bee.yaml
bee start --config=.bee.yaml & pid=$!;
wait;
else
bee start --config=.bee.yaml --bootnode=/ip4/${{ include "bee.fullname" . | upper | replace "-" "_" }}_0_P2P_SERVICE_HOST/tcp/7070/p2p/{{ .Values.bootnode.libp2p_underlay }}
bee start --config=.bee.yaml --bootnode=/ip4/${{ include "bee.fullname" . | upper | replace "-" "_" }}_0_P2P_SERVICE_HOST/tcp/7070/p2p/{{ .Values.bootnode.libp2p_underlay }} & pid=$!;
wait;
fi;
{{- else}}
- bee
Expand Down

0 comments on commit b43707e

Please sign in to comment.