s3rj1k / ninit Goto Github PK
View Code? Open in Web Editor NEWninit is a simple PID 1 init replacement for containers (k8s) that can also send reload signals on application config changes, can also be used as a library
License: MIT License
ninit is a simple PID 1 init replacement for containers (k8s) that can also send reload signals on application config changes, can also be used as a library
License: MIT License
Add INIT_RELOAD_SIGNAL_TO_PGID that controls how reload
signals are sent.
To single process denoted by PID or to a process group denoted by process group ID (-PID).
https://unix.stackexchange.com/a/68759
"[…] When an argument of the form '-n' is given, and it is meant to denote a process group […]"
"[…] If pid is less than -1, then sig is sent to every process in the process group whose ID is -pid. […]"
"[…] If pid is negative, but not -1, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the absolute value of pid, […]"
With default value of false
: only send to specified PID
Add INIT_RELOAD_SIGNAL_TO_GPID that controls how reload
signals are sent.
To single process denoted by PID or to a process group denoted by process group ID (-PID).
https://unix.stackexchange.com/a/68759
"[…] When an argument of the form '-n' is given, and it is meant to denote a process group […]"
"[…] If pid is less than -1, then sig is sent to every process in the process group whose ID is -pid. […]"
"[…] If pid is negative, but not -1, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the absolute value of pid, […]"
This can be used to pause changes watcher for a time when some external library is writing changes to disk.
Purpose of this is to validate child application config before reload, if config is invalid, log error, do not send reload signal.
Current log levels (from less verbose to most verbose):
Similar to:
envar: INIT_SIGNAL_TO_DIRECT_CHILD_ONLY
In this mode, signals (excluding reload signal, configured separately) are only forwarded
to direct child and not to any of its descendants, meaning signal is sent to PID instead of PGID
This should help with writing custom inits, for specific usage, like watching changed CR's in k8s and updating application config according to CR changes.
Should be independent of signal send in terms of configuration.
Could be both signal and cmd or only one of them.
Also should be a none blocking exec.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.