knowledge: PID-1 tee log capture pattern, BSD/GNU date %3N feature detection#3
Open
dch0202-rsquare wants to merge 4 commits into
Open
Conversation
…cs_path pin, TERM-trap foreground deferral)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Knowledge flush — 2 insight(s) (+1 retired as already flushed)
Cross-Check: 독립 서브에이전트 적대검증 1회 — date 페이지 CONFIRMED(GNU coreutils 컨테이너·macOS 26.5.1 양쪽 실측, case 패턴 분기 검증), entrypoint 페이지는 큐 원문의 TERM trap 근거가 실증상 반대(무trap SIGTERM에도 bash EXIT trap 실행; foreground 자식 뒤 TERM trap은 지연→SIGKILL 137, flush 0건)임을 적발 → background 자식+
wait+시그널 포워딩 패턴으로 재작성 후 반영. 재현 아티팩트: bash 4.4/5.2 PID-1 docker 실험 각 10회.Decision Log
container-metrics-when-cadvisor-is-empty.md로 이미 반영(metrics_path 핀 + image!="" 복합 필터까지 커버 확인). 큐 row가 retire되지 않아 재등장한 것 — 이번 flush에서 재반영 없이 retire만 함. 작성했던 중복 페이지는 커밋 이력에서 제거.platforms/shells/portable-shell-scripts.md에 병합 — 배제: 트리거가 셸 이식성이 아니라 PID-1 컨테이너 시맨틱이라infrastructure/containers신규 페이지가 맞음 (one case per page).trap 'exit 143' TERM단독) 그대로 반영 — 배제: 적대검증 실험에서 반박되어 교정 후 반영.entrypoint-log-capture.mdstep 2(background-child+wait 패턴 — 교차검증으로 재작성된 부분)와 Sources의 두 독립 재현 기록,bsd-vs-gnu-cli.md추가 행의 case 패턴 분기.wiki/infrastructure/index.md는 PR #2도 수정하므로 머지 순서에 따라 사소한 충돌 가능.d43103-rsquare not found) — 레포 소유자 리뷰(스킬 기본 모델)로 진행.Verified best-practice
1. PID-1 entrypoint bash with
exec > >(tee -a f)loses log output → EXIT-trap fd close +wait "$TEE_PID"; long foreground jobs need background-child +wait+ TERM forwarding.Verified against:
wait "$!"since bash 4.4 (also confirmed in bash CHANGES, bash-4.4 section).docker stopran the EXIT trap (exit 143);trap 'exit 143' TERMbehind a foreground child was deferred until SIGKILL (exit 137, no flush).The queued candidate's original
trap 'exit 143' TERMdirective was corrected during cross-check — the page teaches the working background-child pattern instead. confidence: verified. (gnu.org bash manual rate-limited with HTTP 429 during this flush; the case.edu mirror + Wooledge are cited instead — no unverified URL included.)2. BSD/GNU
datems-timestamp feature detection → test the actual%3Noutput shape, not%Npresence.Verified against:
%and the specifier is a GNU extension.date +%N→ digits,date +%3N→ literal3N. Adversarial re-check additionally ran GNU coreutils (debian container):date +%3N→ exactly 3 digits, and confirmed thecase … [0-9][0-9][0-9])pattern takes the GNU path on GNU and falls through on macOS.confidence: verified.
Retired without re-ingesting: the OrbStack kubelet
/metrics/resourceinsight (hashab44b921a1f3f759) — already flushed as open PR #2 (container-metrics-when-cadvisor-is-empty.md) but never removed from its session queue file; verified PR #2's page already covers the chart defaults, the label-set difference, and themetrics_path="/metrics/cadvisor"+image!=""dashboard exclusion, so nothing new to add.Existing-layer check
Read: root
INDEX.md,wiki/infrastructure/index.md,wiki/platforms/index.md, and every overlapping page:observability/logs-metrics-signals.md,containers/resource-limits-and-probes.md,containers/image-builds.md,shells/portable-shell-scripts.md,tools/bsd-vs-gnu-cli.md, plus open PR #2'scontainer-metrics-when-cadvisor-is-empty.md(via the PR branch).portable-shell-scriptscovers shell portability,image-buildscovers Dockerfiles; neither covers PID-1 runtime log/signal behavior. No conflict. Created new page; related-linked both ways toimage-buildsandportable-shell-scripts(cross-domain), one-way tologs-metrics-signals.%3N): direct overlap withplatforms/tools/bsd-vs-gnu-cli.md(same trigger family — its "Relative date" row already coversdate -dvs-v). Merged: one command-table row (sub-second timestamp), one edge-case row (%Nprinting digits on macOS must not imply GNU), two sources,last_verifiedbumped to 2026-07-15. No new page.Conflicts flagged: none in content. Noted:
wiki/infrastructure/index.mdis also touched by open PR #2 (different rows) — trivial merge-order conflict possible.Routing decision
infrastructure/containers/entrypoint-log-capture.md(new page)%3Ndetectionplatforms/tools/bsd-vs-gnu-cli.md(merge)/metrics/resourceNothing left
unverified. Queue rows retired to~/.dev-loop/queue/.processed.jsonlafter PR creation.