Serve unlink-dangling, so a leftover enable link goes through the seat
systemctl disable leaves a link whose unit file is gone, and the manager keeps asking for the unit. The verb removes only such links in the account's or the machine's own configuration, on the person's word, and records each with its reason before removing it (hq issue 332).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// systemd's tools: the node-service-manager seat's eleven verbs — the units on this machine in both scopes,
|
||||
// read and acted on by name, their journal, what has failed, what wants a unit, and a failed record cleared
|
||||
// systemd's tools: the node-service-manager seat's twelve verbs — the units on this machine in both scopes,
|
||||
// read and acted on by name, their journal, what has failed, what wants a unit, a dangling enable link removed and a failed record cleared
|
||||
// (novox/hq ADR 0177, issue 332). The node tools runtime launches this bundle as a process of its own and serves what it serves (ADR 0188, ADR 0193);
|
||||
// it runs as the operator account, so acts on the system manager, and reads of its journal, escalate with
|
||||
// sudo -n, and the user scope is the account's own manager (client.go). The host applies units; this answers
|
||||
@@ -145,6 +145,29 @@ func tools(m *Manager) []stdio.Tool {
|
||||
}
|
||||
return m.WantedBy(scope, unit)
|
||||
}},
|
||||
// **A dangling enable link removed on the person's word** (novox/hq issue 332): `disable` leaves it
|
||||
// once the unit's file is gone. Recorded before it is removed (unlink.go).
|
||||
{Name: seat + ".unlink-dangling",
|
||||
Description: "Remove the dangling enable links named for one unit — links in a *.wants, *.requires or *.upholds " +
|
||||
"directory of the account's or the machine's own configuration whose target does not exist, which " +
|
||||
"`disable` leaves once the unit's file is gone — on the person's word: `why` is required. Each link is " +
|
||||
"recorded first (its path, its target, the person's reason) in the module's state, then removed, and " +
|
||||
"the manager reloaded. A link whose target exists, a package's, a generator's or the runtime's is left, " +
|
||||
"and said. `wanted-by` shows what it would remove.",
|
||||
Input: map[string]any{"scope": scopeArg, "unit": unitArgS,
|
||||
"why": str("the person's reason for removing the links, kept in the record")},
|
||||
Run: func(a map[string]any) (any, error) {
|
||||
scope, err := scopeOf(a)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
unit, err := unitOf(a)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
why, _ := a["why"].(string)
|
||||
return m.UnlinkDangling(scope, unit, why)
|
||||
}},
|
||||
// Was the module's own systemd_failed; on the seat since the operator's direction of 2026-10-07, so
|
||||
// whatever holds the role answers it and every machine is asked the same way.
|
||||
{Name: seat + ".failed",
|
||||
@@ -184,7 +207,8 @@ func fromEnv() *Manager {
|
||||
home, _ = os.UserHomeDir()
|
||||
}
|
||||
return &Manager{Account: account, UID: uid, User: name, Run: execRunner, Read: readFile, Env: os.Environ(),
|
||||
Home: home, ReadDir: readDir}
|
||||
Home: home, ReadDir: readDir, Lstat: lstatEntry, Remove: os.Remove,
|
||||
State: strings.TrimSpace(os.Getenv("MESH_SYSTEMD_STATE"))}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user