diff --git a/ci/bin/launch-server.sh b/ci/bin/launch-server.sh index 52753c3..93274a5 100755 --- a/ci/bin/launch-server.sh +++ b/ci/bin/launch-server.sh @@ -23,4 +23,4 @@ if [[ "x${CSI_MODE}" != "x" ]];then fi # > "${LOG_PATH}" 2>&1 -./bin/democratic-csi --log-level debug --driver-config-file "${CONFIG_FILE}" --csi-version "${CSI_VERSION}" --csi-name "driver-test" --server-socket "${CSI_ENDPOINT}" ${EXTRA_ARGS} +exec ./bin/democratic-csi --log-level debug --driver-config-file "${CONFIG_FILE}" --csi-version "${CSI_VERSION}" --csi-name "driver-test" --server-socket "${CSI_ENDPOINT}" ${EXTRA_ARGS} diff --git a/ci/bin/run.sh b/ci/bin/run.sh index 5260dcd..fd1c7ac 100755 --- a/ci/bin/run.sh +++ b/ci/bin/run.sh @@ -3,7 +3,13 @@ set -e set -x -trap 'kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')' EXIT +_term() { + [[ -n "${SUDO_PID}" ]] && kill -- "${SUDO_PID}" +} + +trap _term EXIT + +#trap 'kill -- -$(ps -o pgid= $PID | grep -o '[0-9]*')' EXIT #trap 'kill -- -$PGID' EXIT #trap 'sudo kill -- -$PGID' EXIT #trap 'sudo kill $(jobs -p)' EXIT @@ -18,6 +24,7 @@ export CI_BUILD_KEY=$(uuidgen | cut -d "-" -f 1) # launch the server sudo -E ci/bin/launch-server.sh & +SUDO_PID=$! # wait for server to launch sleep 10