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

SIGINT signals through crun fail #230

Closed
baude opened this issue Jan 28, 2020 · 4 comments · Fixed by #233
Closed

SIGINT signals through crun fail #230

baude opened this issue Jan 28, 2020 · 4 comments · Fixed by #233
Assignees

Comments

@baude
Copy link
Member

baude commented Jan 28, 2020

When sending a SIGINT to a crun container, the signal seems to get eaten or ignored. If replace crun with runc, the it seems to work. What I don't understand is why this seems to be only observed using the remote podman client.

The following reproducer gets to the heart of the matter reasonably quick.


set -e
#signals=(1 2 3 4 5 6 8 10 12 13 14 15 16 20 21 22 23 24 25 26 64)
signals=(15 2)
SOCK_FILE=$(mktemp --dry-run --tmpdir io.podman.XXXXXX)
VARLINK_LOG=$(mktemp --dry-run --tmpdir varlink.log.XXXXXX)
export PODMAN_VARLINK_ADDRESS=unix:$SOCK_FILE
PODMAN="podman --runtime=crun"
PODMAN_REMOTE="podman-remote"

cleanup() {
    set +e
    echo "Cleaning up"
    $PODMAN_REMOTE stop --timeout 0 foobar
    $PODMAN_REMOTE rm -f foobar
    kill -9 %1
    rm -f $SOCK_FILE
    echo "Varlinkg log file: $VARLINK_LOG"
}

trap cleanup EXIT
echo "Starting background varlink server"
sudo rm -rf ${HOME}/.local/share/containers ${HOME}/.config/containers
$PODMAN varlink --timeout=0 $PODMAN_VARLINK_ADDRESS &> $VARLINK_LOG &
sleep 5s
echo "Starting background signal-recipient container"
$PODMAN_REMOTE run -d --name=foobar fedora-minimal sh -c "for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done; echo READY; while ! test -e /stop; do sleep 0.05; done;echo DONE"

for s in $(fmt --width=2 <<< "${signals[*]}" | sort -r); do
    echo "Sending signal $s"
    $PODMAN_REMOTE kill -s $s foobar &> /dev/null
    sleep 0.1s
    $PODMAN_REMOTE logs --tail 1 foobar
done
sleep 3s
echo "Final, complete ourput from foobar container:"
$PODMAN_REMOTE logs foobar
@baude
Copy link
Member Author

baude commented Jan 28, 2020

@giuseppe can you take a look at this? we need this to get F31 CI testing working for podman. many thanks!

@giuseppe
Copy link
Member

fixed here: #233

AFAICS, crun doesn't change the signals, so it might be podman-remote to do it.

It is possible to reset the handlers to the default with env --default-signal sh.. I suggest to leave the env --default-signal block anyway, as this behaviour is not specified in the OCI specs.

@baude
Copy link
Member Author

baude commented Jan 29, 2020

@giuseppe the change of signal was a misinterpretation of the things initially. It looks like from our side the signal is just eaten.

@baude
Copy link
Member Author

baude commented Jan 29, 2020

confirmed this fixes things

cevich added a commit to cevich/podman that referenced this issue Feb 25, 2020
snj33v pushed a commit to snj33v/libpod that referenced this issue May 31, 2020
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

Successfully merging a pull request may close this issue.

2 participants