@@ -266,7 +266,18 @@ Numeric env vars are parsed as **non-negative decimal**. If a value is invalid/o
266266- ` EP_ARM64_FALLBACK` (ARM64/QEMU only)
267267 If set to ` 1` , ARM64 builds skip the epoll/signalfd path and use a simpler
268268 ` wait4` loop. Intended as a workaround for QEMU user-mode flakiness in CI smoke tests.
269- This mode does ** not** provide the full signal-forwarding/grace-timer behavior; it primarily verifies spawn + exit-code propagation.
269+
270+ ** WARNING:** This mode is a CI testing stub and is ** NOT suitable for production use** .
271+ It does ** NOT** provide:
272+ - Signal forwarding to child process group
273+ - Graceful shutdown with grace period escalation
274+ - Restart-on-crash functionality
275+ - Custom signal monitoring (EP_SIGNALS)
276+
277+ Fallback mode only verifies basic spawn and exit code propagation. Use it ** only**
278+ for CI smoke testing under QEMU user-mode emulation. For production, run the full
279+ binary on native ARM64 hardware or use full-system emulation.
280+
270281 In fallback mode, verbose logs may omit timestamps to avoid QEMU-user emulation issues.
271282 Default: ` 0` (CI jobs typically set this).
272283
@@ -307,6 +318,34 @@ EP_RESTART_ENABLED=1 EP_MAX_RESTARTS=0 EP_RESTART_BACKOFF_SECONDS=0 \
307318 ./build/mini-init-amd64 -- ./your-app
308319` ` `
309320
321+ # ## Best Practices
322+
323+ # ### Restart Configuration
324+
325+ When enabling restart-on-crash (` EP_RESTART_ENABLED=1` ):
326+
327+ - ** Always set a backoff delay** (` EP_RESTART_BACKOFF_SECONDS` ) to prevent tight restart loops
328+ - Recommended minimum: ` 1` second (default)
329+ - For flaky apps: ` 5-10` seconds
330+
331+ - ** Set a restart limit** (` EP_MAX_RESTARTS` ) to prevent infinite loops on persistent failures
332+ - Recommended: ` 3-5` restarts for transient errors
333+ - Use ` 0` (unlimited) only for long-running services with rare crashes
334+
335+ ** Example - Good configuration:**
336+ ` ` ` bash
337+ # Bounded restarts with backoff (recommended)
338+ EP_RESTART_ENABLED=1 EP_MAX_RESTARTS=3 EP_RESTART_BACKOFF_SECONDS=5 \
339+ ./build/mini-init-amd64 -- ./my-app
340+ ` ` `
341+
342+ ** Example - Dangerous configuration:**
343+ ` ` ` bash
344+ # Unlimited restarts with no delay (tight loop on immediate crash - avoid!)
345+ EP_RESTART_ENABLED=1 EP_MAX_RESTARTS=0 EP_RESTART_BACKOFF_SECONDS=0 \
346+ ./build/mini-init-amd64 -- ./my-app
347+ ` ` `
348+
310349# ## Exit code semantics
311350
312351- Child exits normally → ` mini-init-asm` returns the ** child exit code** .
@@ -477,6 +516,52 @@ bash scripts/test_diagnostics.sh build/mini-init-arm64
477516
478517---
479518
519+ # # Debian Packaging
520+
521+ # ## Package Information
522+
523+ The Debian package ` mini-init-asm` provides a unified binary:
524+ - ** Installed at:** ` /usr/bin/mini-init-asm`
525+ - ** Architecture-specific:** Built for ` amd64` and ` arm64` only
526+ - ** Statically linked:** No runtime dependencies (libc-free)
527+
528+ # ## Building the Debian Package
529+
530+ ` ` ` bash
531+ # Install build dependencies
532+ sudo apt-get install debhelper-compat binutils nasm make
533+
534+ # Build binary package
535+ dpkg-buildpackage -us -uc -b
536+
537+ # Install locally
538+ sudo dpkg -i ../mini-init-asm_* .deb
539+ ` ` `
540+
541+ # ## Running Autopkgtest
542+
543+ ` ` ` bash
544+ # After installing package
545+ autopkgtest . -- null
546+
547+ # Or from source tree with schroot
548+ autopkgtest -B . -- schroot unstable-amd64
549+ ` ` `
550+
551+ # ## Lintian Check
552+
553+ ` ` ` bash
554+ lintian --fail-on warning --display-info ../mini-init-asm_* .deb
555+ ` ` `
556+
557+ # ## Supported Architectures
558+
559+ Currently supported: ** amd64** , ** arm64**
560+
561+ Other architectures are not supported due to the assembly implementation.
562+
563+ ---
564+
480565# # Security notes
481566
482567- No privilege dropping, seccomp profiles, or capabilities tuning are implemented here.
0 commit comments