Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Use the -9 kill signal with pkill
Browse files Browse the repository at this point in the history
When `helm tiller start-ci` is run in a golang/exec command, running `helm tiller stop` in the parent shell or a different golang/exec command does not stop the `./bin/tiller` process.

I ran into this when trying to start `helm tiller start-ci` in a terragrunt before hook and terragrunt uses golang/exec to run their commands.

In golang/exec (https://golang.org/pkg/os/exec/) it says this:

"Unlike the "system" library call from C and other languages, the os/exec package intentionally does not invoke the system shell ..."

Which is the likely cause of the issue.

To overcome this, all we need to do is to change `pkill -f ./bin/tiller` to `pkill -9 -f ./bin/tiller`. Sending `-9` means sending a stronger kill signal to the process, to ensure even non-responding process are killed.
  • Loading branch information
isen-ng authored Jul 5, 2019
1 parent 668692d commit 6be4d04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/tiller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ stop_tiller() {
if [[ "${HELM_TILLER_SILENT}" == "false" ]]; then
echo "Stopping Tiller..."
fi
pkill -f ./bin/tiller
pkill -9 -f ./bin/tiller
}
COMMAND=$1
Expand Down

0 comments on commit 6be4d04

Please sign in to comment.