Giter Club home page Giter Club logo

Comments (3)

tianon avatar tianon commented on August 16, 2024

I think this means your process doesn't have a handler for SIGUSR2 registered; from signal(7) (https://manpages.debian.org/bullseye/manpages/signal.7.en.html#Standard_signals), SIGUSR2 is a terminating signal by default.

from tini.

rayrapetyan avatar rayrapetyan commented on August 16, 2024

Hm, I didn't know SIGUSRs are terminating by default, that's why used a random web server as example, sorry. But initially this issue happened with my own image which has a SIGUSR2 handler. I've created a POC repo: https://github.com/rayrapetyan/test_sig.

Steps to reproduce the issue:

  1. Run cmd.sh locally
  2. See output:
PID of this script: 433226
Running....
Running....
...
  1. Send SIGUSR2 signal: kill -SIGUSR2 433226
  2. Notice signal was intercepted in cmd.sh:
handling SIGUSR2
Running....

and process continues running as expected.

Now run cmd.sh from container:

docker build -t test_sig:latest .
docker run --rm --init --name test_sig test_sig:latest

Send SIGUSR2:
docker kill --signal SIGUSR2 test_sig

Expected: cmd.sh running inside a docker container should receive and handle a signal and continue running.
Actual: container stops.

Now after looking into how cmd.sh is running inside a container:
/sbin/docker-init -- /bin/sh -c ./cmd.sh -> bash cmd.sh
I realize that because of /bin/sh is running before bash, it's intercepting all signals and doesn't forward them to a child processes (bash) properly?

from tini.

rayrapetyan avatar rayrapetyan commented on August 16, 2024

Works when running as:
docker run --rm --init --name test_sig test_sig:latest ./cmd.sh
so no /bin/sh in between.

from tini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.