chore: simplify cluster controller initialisation, prepare for reset

This commit is contained in:
Pasha Sviderski committed 2025-07-24 14:23:33 +10:00
1 parent f613d3ce6d
commit 9a88e914f4
6 files changed
+227 -388

No files matched your search

+9
View File
@@ -27,6 +27,15 @@ func (s *SystemdService) Start(ctx context.Context) error {
return s.startOrRestart(ctx, "start")
}
func (s *SystemdService) Stop(ctx context.Context) error {
if _, err := exec.Command("systemctl", "stop", s.Unit).Output(); err != nil {
return fmt.Errorf("systemctl stop %s: %w", s.Unit, err)
}
slog.Info("Corrosion systemd service stopped.", "unit", s.Unit)
return nil
}
func (s *SystemdService) Restart(ctx context.Context) error {
return s.startOrRestart(ctx, "restart")
}