Skip to content

Send SIGKILL instead of SIGTERM in watch.sh #24916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

silverwind
Copy link
Member

Should fix the issue mentioned in #24845 (comment).

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 24, 2023
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label May 24, 2023
@silverwind
Copy link
Member Author

Actually, no, I still get processes disassocated with the shell, checking...

@silverwind silverwind marked this pull request as draft May 24, 2023 17:12
@wxiaoguang
Copy link
Contributor

SIGKILL is not the right choice in most cases.

@silverwind
Copy link
Member Author

Actually I can currently not reproduce the zombie processes anymore with the current command, so it may be fine already. Hitting CTRL-C will not wait on the processes to terminate, which may be the reason why I thought it leaves zombies, but actually does not.

FTR, this is what I worked out to kill the processes and all spawned children:

#!/bin/bash
set -euo pipefail

make --no-print-directory watch-frontend &
make --no-print-directory watch-backend &

function cleanup() {
  for PID in $(jobs -p); do
    kill $(pgrep -P $PID) $PID
  done
}
trap cleanup EXIT

wait

@silverwind silverwind closed this May 24, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants