7.7 KiB
7.7 KiB
Tux-Dock Development Log
0.4.1-beta
TUI stability
- Fixed duplicate port mappings shown in the container list TUI. Docker's
/containers/jsonAPI returns separatePortsentries for IPv4 (0.0.0.0) and IPv6 (::) bindings of the same host port; the container parser now deduplicates these into a singlepublic:privatedisplay string. - Added a container parser regression test covering IPv4/IPv6 duplicate port bindings.
- Added
DockerStatePoller, a background thread that silently refreshes cached container/image state from Docker every 5 seconds. This prevents state drift when an Engine API call times out but Docker still applied the change. - Made mutating Engine API operations idempotent:
removeContainertreats404as success,deleteImagetreats404as success, andstartDetachedtreats304as success, eliminating spurious "already removed/started" failures on retry. - Refactored
DockerManagerto accept an injectableDockerEngineClientfor unit testing. - Added unit tests for idempotent Docker manager operations and for
DockerStatePollerlifecycle, periodic polling, and immediate refresh triggers.
Version
- Bumped version to
0.4.1-beta.
0.4-beta
ARM64 / tuxreaperd fixes
- Fixed
tuxreaperdasm.con ARM64 by using the architecture-specificO_DIRECTORYvalue (0x4000onaarch64,0x10000onx86_64). The hardcoded x86_64 value causedopenat("/proc", ...)to fail withEINVAL, which broke/procscanning, descendant waiting, and SIGTERM forwarding on ARM64 Chromebooks/VMs. - Verified graceful Apache shutdown on ARM64: tuxreaperd remaps
SIGTERMtoSIGWINCHfor Apache processes and waits for descendants to finish, allowing in-flight HTTP responses to complete before the container exits. - Added nginx-aware
SIGTERM→SIGQUITremapping in bothtuxreaperdgnu.candtuxreaperdasm.c. Whendocker stopsendsSIGTERM, nginx processes (/usr/sbin/nginx,/usr/local/nginx/sbin/nginx) receiveSIGQUITfor graceful shutdown instead ofSIGTERM. - Added PHP-FPM-aware
SIGTERM→SIGQUITremapping with prefix matching (e.g.,/usr/sbin/php-fpmmatches/usr/sbin/php-fpm8.4) so PHP-FPM receives the correct graceful-shutdown signal when the container stops. - Documented that PHP-FPM graceful shutdown requires
process_control_timeoutto be set in the PHP-FPM pool configuration (e.g.,process_control_timeout = 60s). Without it, the PHP-FPM master exits immediately onSIGQUITand in-flight requests are dropped. - Set the container stop timeout to 60 seconds in
DockerManager::createContainer(--stop-timeout=60) and raised the TUI stop default to 60 seconds, aligning Docker's grace period withtuxreaperd's descendant wait so graceful shutdowns are not cut short by a premature SIGKILL. - Added
--debug-reaperflag tocompile.shto build tuxreaperd withTUXREAPERD_DEBUGand run verbose tests; useful for diagnosing/procscanning, signal broadcasts, and descendant waits. - Added adaptive TTY/non-TTY spinner to
compile.shfor clearer feedback during the test phase. - Added a "Why tuxreaperd?" comparison section to
README.mdwith a feature matrix and ASCII size chart contrastingtuxreaperdwithtini,dumb-init, andmini-init-asm. - Added a "Web workload guide" section to
README.mdcovering Apache, nginx, and PHP-FPM signal conventions, required PHP-FPMprocess_control_timeoutconfiguration, container startup examples, and thesleep.phpverification test.
Version
- Bumped version to
0.4-beta.
0.3.1-beta
Added an optional timeout_seconds parameter to stopContainer
0.3-beta
This release introduces tuxreaperd, a micro init system for containers.
Micro init
- Split the reaper into two implementations:
tuxreaperdgnu.c: the original standard POSIX/libc daemon used as PID 1 inside containers created by tux-dock.tuxreaperdasm.c: a new freestanding-nostdlibsyscall engine forx86_64andaarch64with a tiny static footprint.
- Both run as subreapers (
PR_SET_CHILD_SUBREAPER) with a SIGCHLD handler that reaps every reparented/terminated descendant, so orphaned processes never accumulate as zombies. - Both proxy lifecycle signals (SIGTERM, SIGQUIT, SIGINT, SIGHUP, SIGUSR1, SIGUSR2) to the child process tree and propagate the primary workload's exit status (128 + signal for signal deaths).
- Special-cases Apache's questionable use of
SIGWINCHfor graceful shutdown: whenSIGTERMis received, any process whose/proc/<pid>/exeis/usr/sbin/apache2,/usr/sbin/httpd, or/usr/local/apache2/bin/httpdgetsSIGWINCHinstead, while every other process receivesSIGTERM. compile.shdetects the host architecture and builds the freestanding implementation when possible, falling back totuxreaperdgnu.con failure or unsupported hosts.DockerManager::createContainerbind-mountstuxreaperdinto the container as PID 1 and resolves the binary next to thetux-dockexecutable when it is not in the current directory.
Tests
- Added
tuxreaperd-zombie-tests, an in-container test suite that boots a container withtuxreaperdas PID 1 and verifies orphaned grandchildren are reaped (zero zombies), exit status is propagated, anddocker stopcleanly shuts down via forwarded SIGTERM (exit 143). - The HTML web test view now includes a "Tuxreaperd Zombie Reaping" section alongside the Docker integration and TUI transcript sections.
0.1.2-beta
This release adds signal trapping to prevent state corruption during long-running Docker operations.
Reliability
- Added SIGINT (Ctrl+C) signal trapping during busy operations to prevent premature exit and socket corruption
- Added SIGTSTP (Ctrl+Z) signal trapping during busy operations to prevent suspension mid-operation
- Signals chain to previous handlers when not busy, preserving normal exit and suspend behavior
- Trap re-installs after terminal I/O restoration cycles to maintain protection through Attach Shell sessions
- Used SA_RESTART flag to prevent EINTR on blocking socket reads during signal delivery
TUI
- Added visual feedback in busy modal when signals are trapped
- Shows "Ctrl+C ignored: operation in progress" when SIGINT is trapped
- Shows "Ctrl+Z ignored: operation in progress" when SIGTSTP is trapped
0.1.1-beta
This release establishes the first beta-quality Docker integration and TUI workflow.
Docker integration
- Added direct Docker Engine API access through
/var/run/docker.sock. - Added startup Docker preflight using
GET /_pingbefore launching the TUI. - Added synchronous initial container and image loading.
- Added asynchronous cache refreshes after mutations and interactive sessions.
- Preserved cached state when a refresh fails.
- Added structured container/image JSON mapping with exited-container support.
Process execution
- Replaced
system()andpopen()with afork/execprocess runner. - Added captured stdout/stderr and inherited terminal I/O modes.
- Kept direct CLI execution for interactive terminal handoffs.
Reliability
- Added HTTP response parsing for Content-Length, chunked transfer, and bodyless responses.
- Added robust handling for Docker
204and idempotent304responses. - Added tri-state stop polling: stopped, running, and unknown.
- Added bounded stop retries after transport timeouts.
- Stop completion now refreshes cached state before showing the result modal.
TUI
- Replaced the persistent status panel with a centered actions panel.
- Added busy-operation modals with spinner feedback.
- Blocked input during long-running Docker operations.
- Added structured, scrollable container and image list dialogs.
Tests
- Added HTTP response parser tests.
- Added container JSON mapping tests.
- Added operation-state tests.
- Added stop polling and timeout-sequence regression tests.