Skip to content

Commit

Permalink
Merge pull request #16 from ethersphere/add-trap-init-script
Browse files Browse the repository at this point in the history
add trap to catch SIGTERM and forward it to bee process
  • Loading branch information
Ivan Vandot authored Jun 8, 2020
2 parents dee73e1 + eb6ab06 commit 964bac5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/bee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
appVersion: latest
name: bee
version: 0.3.1
version: 0.3.2
description: Ethereum Swarm Bee Helm chart for Kubernetes
home: https://swarm.ethereum.org
icon: https://swarm-guide.readthedocs.io/en/latest/_images/swarm.png
Expand Down
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 964bac5

Please sign in to comment.