No description
  • Rust 96.3%
  • Dockerfile 3.7%
Find a file
Doridian feea06cff0
All checks were successful
Docker check and push / release (push) Successful in 2m51s
But dont allow skipping services
2026-03-14 12:55:52 -07:00
.cargo Initial 2026-03-10 15:27:06 -07:00
.forgejo/workflows chore(reposyncer): update repo baseline (#5) 2026-03-13 16:26:04 -07:00
src But dont allow skipping services 2026-03-14 12:55:52 -07:00
tests Fix up extraction logic a lot 2026-03-10 21:32:08 -07:00
.dockerignore Initial 2026-03-10 15:27:06 -07:00
.gitignore Initial 2026-03-10 15:27:06 -07:00
Cargo.lock Save 10kB by going low level signals 2026-03-10 18:36:56 -07:00
Cargo.toml Save 10kB by going low level signals 2026-03-10 18:36:56 -07:00
Dockerfile Remove upx 2026-03-11 08:47:01 -07:00
LICENSE MIT 2026-03-10 22:08:59 -07:00
README.md Ensure the container runtime knows we handle SIGTERM 2026-03-11 09:27:20 -07:00
renovate.json chore(reposyncer): update repo baseline 2026-03-10 23:01:23 +00:00
uinitrs.example.json Add dummy file to example ct 2026-03-10 22:01:38 -07:00

uinitrs

Extracts a .tar.zst archive into a target directory. Designed to run early in a Linux init sequence — no shell, no dynamic libraries, no external tools.

Environment variables

Variable Description
SRC_PATH Path to the .tar.zst archive to extract
DEST_PATH Destination directory to extract into

Process manager config

Place a uinitrs.json file at the root of the archive. If absent, uinitrs exits after extraction with no error.

Example config:

{
  "services": [
    {
      "name": "web",
      "binary": "/usr/bin/nginx",
      "args": ["-g", "daemon off;"],
      "working_dir": "/var/www",
      "uid": 33,
      "gid": 33
    },
    ...
  ]
}
Field Required Description
binary yes Absolute path to the executable
working_dir yes Working directory the process is started in
uid yes UID the process runs as
gid yes GID the process runs as
name no Label used in log output (defaults to binary)
args no Arguments passed to the executable (default [])

Each service is supervised independently: if it exits for any reason it is restarted immediately.

Building a static binary

Install the musl target and toolchain for your architecture (Arch Linux):

# x86-64
sudo pacman -S rust-musl musl

# AArch64
sudo pacman -S rust-aarch64-musl musl-aarch64

Then build, passing the target for your architecture:

cargo build --release --target x86_64-unknown-linux-musl   # x86-64
cargo build --release --target aarch64-unknown-linux-musl  # AArch64

Or let the shell pick the right target automatically:

cargo build --release --target "$(uname -m)-unknown-linux-musl"

The resulting binary is fully statically linked with no external runtime dependencies.

Running tests

cargo test