ComixHe/zinit
A tiny init for linux container.
50be7bc7bfe5470bb90bb7c868b88f98078865a6
A tiny init written in Zig for linux container, which for forwarding signal and recycling dead processes.
git clone <repo_url> && cd <project_dir>
zig build --release=safe
Usage: zinit [OPTIONS] -- <command> [args...]
Options:
-h, --help Show help and exit
-v, --version Show version and exit
-s, --signal <SIGNAL> The triggered signal when parent process dies
--forward-mode <MODE> The mode of forwarding signals to child processes
<command>
: The binary to execute.[args...]
: Arguments passed to the child process.#!/path/to/zinit /bin/bash
export YOUR_ENV=SOME_VALUE
# do some preparing
exec my-binary
you can build from source with '-Dtracing-child=true' or set ZINIT_TRACING_CHILD=ON at runtime to make child process waiting before execvpe.
The priority of ZINIT_TRACING_CHILD is higher than build config, you can set this to ON or OFF to override config value.
One usage is using strace to tracing child process.
This project is licensed under the MIT License. See the LICENSE
file for details.