NS-013
observedself-terminating-action
A teardown script destroys the environment it is executing inside
- reads as
- Several long-running sessions vanish at once with no error output. Conclusion drawn: the tool crashed, or the machine failed.
- actually
- A rebuild script ran `kill-session` against the multiplexer session it was itself running in. It killed its own parent, taking four unrelated sessions with it. There is no crash and no error because the script did exactly what it was told.
- blind because
- A process that is killed cannot report that it was killed, and cannot report why. The absence of an error reads as an unexplained crash rather than a successful destructive command.
- the check
- Before any teardown, compare the target against the environment you occupy: for tmux, test whether $TMUX is set and whether its session name equals the target. Refuse if they match.
- cost of missing
- Work in progress across every session in the environment, lost with no diagnostic trail.
- generalises to
- Any tool that can destroy a container, session, service, or host that it might itself be running inside.