Skip to content

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

@technicalpickles

Description

@technicalpickles

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions