- Task queue: all SAT/audit jobs enqueue and run one-at-a-time; tasks persist past page navigation; new Tasks page with cancel/priority/log stream - UI: consolidate nav (Validate, Burn, Tasks, Tools); Audit becomes modal; Dashboard hardware summary badges + split metrics charts (load/temp/power); Tools page consolidates network, services, install, support bundle - AMD GPU: acceptance test and stress burn cards; GPU presence API greys out irrelevant SAT cards automatically - Burn tests: Memory Stress (stress-ng --vm), SAT Stress (stressapptest) - Install to RAM: copies squashfs to /dev/shm, re-associates loop devices via LOOP_CHANGE_FD ioctl so live media can be ejected - Charts: relative time axis (0 = now, negative left) - memtester: LimitMEMLOCK=infinity in bee-web.service; empty output → UNSUPPORTED - SAT overlay applied dynamically on every /audit.json serve - MIME panic guard for LiveCD ramdisk I/O errors - ISO: add memtest86+, stressapptest packages; memtest86+ GRUB entry; disable screensaver/DPMS in bee-openbox-session - Unknown SAT status severity = 1 (does not override OK) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
59 lines
1.5 KiB
Go
59 lines
1.5 KiB
Go
package platform
|
|
|
|
import (
|
|
"os/exec"
|
|
"path/filepath"
|
|
"sort"
|
|
"strings"
|
|
)
|
|
|
|
func (s *System) ListBeeServices() ([]string, error) {
|
|
seen := map[string]bool{}
|
|
var out []string
|
|
for _, pattern := range []string{"/etc/systemd/system/bee-*.service", "/lib/systemd/system/bee-*.service"} {
|
|
matches, err := filepath.Glob(pattern)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
for _, match := range matches {
|
|
name := strings.TrimSuffix(filepath.Base(match), ".service")
|
|
// Skip template units (e.g. bee-journal-mirror@) — they have no instances to query.
|
|
if strings.HasSuffix(name, "@") {
|
|
continue
|
|
}
|
|
if !seen[name] {
|
|
seen[name] = true
|
|
out = append(out, name)
|
|
}
|
|
}
|
|
}
|
|
sort.Strings(out)
|
|
return out, nil
|
|
}
|
|
|
|
func (s *System) ServiceState(name string) string {
|
|
raw, err := exec.Command("systemctl", "is-active", name).CombinedOutput()
|
|
if err == nil {
|
|
return strings.TrimSpace(string(raw))
|
|
}
|
|
raw, err = exec.Command("systemctl", "show", name, "--property=ActiveState", "--value").CombinedOutput()
|
|
if err != nil {
|
|
return "unknown"
|
|
}
|
|
state := strings.TrimSpace(string(raw))
|
|
if state == "" {
|
|
return "unknown"
|
|
}
|
|
return state
|
|
}
|
|
|
|
func (s *System) ServiceDo(name string, action ServiceAction) (string, error) {
|
|
raw, err := exec.Command("systemctl", string(action), name).CombinedOutput()
|
|
return string(raw), err
|
|
}
|
|
|
|
func (s *System) ServiceStatus(name string) (string, error) {
|
|
raw, err := exec.Command("systemctl", "status", name, "--no-pager").CombinedOutput()
|
|
return string(raw), err
|
|
}
|