Code Monkey home page Code Monkey logo

Comments (2)

skarnet avatar skarnet commented on June 14, 2024 1

It's not only about looking for a handler script when a signal arrives. s6-svscan has to explicitly catch the signal first. That's why you couldn't make SIG??? work - the signals you wanted are simply not caught.

There's no major theoretical objection to what you want, but there are a few practical ones, that makes catching each and every signal very difficult to do portably. One of them is that there is an implementation-defined set of signals you just cannot trap, and on some systems sigaction() fails, and making sure the failure is due to an uncatchable signal and not a kernel issue is a problem that requires either a lot of code, or #ifdef mazes, to be solved correctly. Other issues are, for instance, how to establish a bijection between a signal such as SIGRTMIN+3 and its handler script for an (almost) arbitrarily large number of signals, without breaking compatibility with existing names, and without being entirely counter-intuitive (SIG13, SIG14, SIGTERM, SIG16, what?)

s6-svscan aims to be portable, and is a very critical piece of code, so I want to keep it as simple as possible. I had already thought about generalizing the signal diversion mechanism, but in the end the benefits aren't worth the amount of code and complexity that it would add. I'm sorry. You'll end up with much less complexity on your system by just setting lxc.signal.halt. :-)

from s6.

gtbuchanan avatar gtbuchanan commented on June 14, 2024

No worries. Thought it couldn't hurt to ask :) I figured it was something more complex than I was aware of in my limited C knowledge. I'm developing some generic LXC images and I was trying to avoid having to tell people to always set lxc.signal.halt, but sounds like that's the easiest solution. Thank you for the detailed explanation!

from s6.

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.