Skip to content
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

CLI should trap signals and pass them on to processes #39

Open
technicalpickles opened this issue Aug 17, 2024 · 0 comments
Open

CLI should trap signals and pass them on to processes #39

technicalpickles opened this issue Aug 17, 2024 · 0 comments

Comments

@technicalpickles
Copy link
Collaborator

I am trying to profile bin/rails server backgrounded in a script, and then kill it at the end. When I go to kill it, it seems to only kill the singed process, and rbspy that it is calling.

cleanup() {
        local pids
        pids=$(jobs -pr)
        if [ -n "$pids" ]; then
          echo "Killing processes: $pids"
          kill $pids
        fi
}
trap "cleanup" SIGINT SIGTERM EXIT

echo "Starting server"
bin/rails server &

I'm not sure if rbspy is smart enough to be able to dump its progress or not, but at least trapping and passing it on would be a good first step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant