@@ -437,6 +437,55 @@ Castle's job is configuration and release management on a running node.
437437 ` RELEASES ` file names at least ` kernel ` and ` stdlib ` . The remedy the message
438438 names is a restart, because that is the only thing that changes the answer.
439439
440+ ** A restart is necessary and not always sufficient, so the message names the
441+ state the file has to be in rather than just saying "restart".** The record is
442+ synthesised when ` RELEASES ` was missing * or* could not be read, and Forecastle's
443+ ` env.sh ` creates it only when it is ** absent** (` [ ! -f ... ] ` ). So a file that
444+ is present and unreadable is stepped over on every start: the node comes back on
445+ a freshly synthesised record, the refusal repeats, and an operator following a
446+ message that named only the restart would loop forever.
447+
448+ ** State the required condition, not the boot-time cause.** The obvious
449+ correction — branch the advice on why the record was synthesised, absent versus
450+ unreadable — is wrong in a third case, and that was the first attempt here. The
451+ file can have been absent at boot and been created, readably, since: the node
452+ keeps its synthesised record either way, so the refusal still fires, and an
453+ operator told to check whether the file is "absent" or "present and unreadable"
454+ finds it is neither and has no applicable advice. A plain restart is exactly
455+ right for them. So the message asks for ` releases/RELEASES ` to be * absent or
456+ consultable* before the restart, which covers all three states and is shorter
457+ than the branch it replaced. Do not turn it back into a case analysis of the
458+ cause, and do not collapse it into a bare "restart the system" either.
459+
460+ ** Name the authority, not the mechanism — and this is the lesson of five
461+ successive corrections to one sentence.** Each named a property of the file and
462+ each was necessary but not sufficient, so each admitted a narrower
463+ counterexample: "restart" missed a file that was present and unreadable;
464+ "present or absent" missed one created readably since boot; "readable" missed
465+ malformed terms, because ` init/1 ` reads it with ` file:consult/1 ` ; "consultable"
466+ missed a file of two valid terms, because ` init/1 ` accepts only ` {ok, [Term]} ` .
467+ There is no reason to think that series had ended, and the hook leaves an
468+ existing file alone whatever is in it, so every one of those states loops.
469+
470+ The message therefore asks for a file ** ` :release_handler ` accepts** , and says
471+ that no single property of the file is the test. That cannot be narrowed further
472+ because it does not claim a mechanism, and it is what an operator needs anyway:
473+ the handler is the thing that has to take the file. Do not "improve" it by
474+ substituting whichever internal criterion is current — that is the move that was
475+ wrong five times.
476+
477+ ** And it must not name ` releases/RELEASES ` unqualified** , because that is the
478+ file the * release* creates, not necessarily the one the handler reads — see
479+ ` Castle.Deployment.root_dir/0 ` and
480+ [ #23 ] ( https://github.com/ausimian/castle/issues/23 ) . Where ` RELDIR ` or
481+ ` {sasl, releases_dir} ` points elsewhere the two are different files, and the
482+ remedy is then genuinely harder rather than merely differently spelled: the
483+ hook creates one at the root that the handler will not read, so "absent" does
484+ not get the operator out either, and the file the handler * does* read has to be
485+ put there by hand. The message says so. When #23 lands and Castle follows those
486+ overrides, this paragraph and that sentence both need revisiting — the
487+ divergence is the thing being described, and it is the thing #23 removes.
488+
440489 It has to be asked of the node rather than of the filesystem — a file that
441490 appeared * after* the boot that looked for it passes a shell test and still
442491 leaves the node on the synthesised record — and it has to be asked * in the call
0 commit comments