power: the sleep hooks are wanted by the sleep targets, not declared as services
The host reads a one-shot that is not running as having run, so a before-sleep or after-wake unit declared stopped failed on its first apply; drop-ins on the sleep targets pull them in instead.
This commit is contained in:
@@ -32,8 +32,11 @@ func (m *Machine) Check(ctx context.Context, w *Watcher) map[string]any {
|
||||
enabled, _ := m.Run(ctx, "systemctl", "is-enabled", u)
|
||||
enabled = strings.TrimSpace(enabled)
|
||||
want := "enabled"
|
||||
if u == "mesh-power-supply.service" {
|
||||
switch u {
|
||||
case "mesh-power-supply.service":
|
||||
want = "static" // started by the udev rule, never by a target
|
||||
case "mesh-power-before-sleep.service", "mesh-power-after-wake.service":
|
||||
want = "static" // wanted by the sleep targets through the module's drop-ins, never enabled
|
||||
}
|
||||
add(u, present && enabled == want, "%s: file present %v, %s (want %s)", Units[u], present, orWord(enabled, "unknown"), want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user