chore: simplify cluster controller initialisation, prepare for reset

This commit is contained in:
Pasha Sviderski
2025-07-24 14:23:33 +10:00
parent f613d3ce6d
commit 9a88e914f4
6 changed files with 227 additions and 388 deletions
+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")
}