Giter Club home page Giter Club logo

Comments (5)

exalted avatar exalted commented on September 24, 2024 1

@spujadas thanks for fixing it, however don't you think it is sort of duplication in what's in start.sh already? Perhaps you may want to consider something like in startx.sh instead:

_term() { 
  kill -TERM "$child" 2>/dev/null
}

trap _term SIGTERM

/usr/local/bin/start.sh &

child=$! 
wait "$child"

^ Ref.: https://unix.stackexchange.com/questions/146756/forward-sigterm-to-child-in-bash

So startx.sh shouldn't really "know" how to kill what start.sh is starting, merely forward the term signal to it.

More good stuff in http://veithen.github.io/2014/11/16/sigterm-propagation.html as well.

What do you think?

from elkx-docker.

spujadas avatar spujadas commented on September 24, 2024

Well spotted, should now be solved (build in progress), let me know if you're still experiencing this issue.

from elkx-docker.

spujadas avatar spujadas commented on September 24, 2024

Clever and infinitely more elegant than my quick and dirty workaround, thanks!
Will implement your solution.

from elkx-docker.

spujadas avatar spujadas commented on September 24, 2024

Great stuff, just needed an extra wait ${child} in the _term() function otherwise startx.sh wouldn't wait for start.sh to end before exiting.

from elkx-docker.

exalted avatar exalted commented on September 24, 2024

Yeah, I didn't experiment with the whole thing, however also in http://veithen.github.io/2014/11/16/sigterm-propagation.html there are two waits; so I think it makes sense.

Thanks for the fix! 🙇

from elkx-docker.

Related Issues (18)

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.