H2, H8 (H-A-735): the owner pass at the engine's start stops and starts the module's units; composition-diff keeps the entry's name, the words go to the journal

Builds: design 47 H2 H-A-641, H-A-701, H-A-710 (4), H-A-735
This commit is contained in:
2026-11-25 17:23:16 +01:00
parent 39964d32d8
commit 180d57fe16
7 changed files with 169 additions and 18 deletions
+9 -4
View File
@@ -281,7 +281,7 @@ func awaitBackup(ctx context.Context, events <-chan []byte, node, module string,
// its processes written again where it lacks its node's name (H-A-713), one line each.
func takenAtStartIn(opts options, say func(string)) func(module string, runs compositions.Composed) {
return func(module string, runs compositions.Composed) {
for _, line := range convergeDirectories(opts.state, runs) {
for _, line := range convergeDirectories(context.Background(), opts, runs) {
say(line)
}
for _, line := range convergeUnits(context.Background(), opts, runs) {
@@ -322,16 +322,21 @@ func convergeUnits(ctx context.Context, opts options, runs compositions.Composed
// convergeDirectories gives each directory entry of runs that this node's record holds, drifted on disk, its declared
// owner and mode (apply.ConvergeDirectories, H-A-374, H-A-392): one line per directory, and one when the record or the
// composition does not read.
func convergeDirectories(statePath string, runs compositions.Composed) []string {
func convergeDirectories(ctx context.Context, opts options, runs compositions.Composed) []string {
d, err := declarationOf(runs)
if err != nil {
return []string{fmt.Sprintf("the directories of %s are not judged at this start: its composition does not read: %v", runs.Module, err)}
}
known, err := store.Load(statePath)
known, err := store.Load(opts.state)
if err != nil {
return []string{fmt.Sprintf("the directories of %s are not judged at this start: %v", runs.Module, err)}
}
return apply.ConvergeDirectories(d, known)
// Read only where a pass needs its units stopped: a host that is not built for a system says so there.
built, builtErr := system.For(builtFor)
if builtErr != nil {
built = nil
}
return apply.ConvergeDirectories(ctx, built, d, known, opts.run())
}
// declarationOf is the declaration the compositions make together: their resources, and the node's own parts when the