more debug stuff

pull/11666/head
Ilya Zuyev 2021-06-11 16:09:57 -07:00
parent 78a07e71bb
commit 9d64921653
2 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,7 @@ func pause(cr cruntime.Manager, r command.Runner, namespaces []string) ([]string
// Disable the kubelet so it does not attempt to restart paused pods
sm := sysinit.New(r)
klog.Info("kubelet running: %v", sm.Active("kubelet"))
klog.Info("kubelet running: ", sm.Active("kubelet"))
if err := sm.DisableNow("kubelet"); err != nil {
return ids, errors.Wrap(err, "kubelet disable --now")

View File

@ -42,6 +42,8 @@ func (s *Systemd) daemonReload() error {
// Active checks if a service is running
func (s *Systemd) Active(svc string) bool {
_, _ = s.r.RunCmd(exec.Command("sudo", "systemctl", "is-enabled", svc))
_, _ = s.r.RunCmd(exec.Command("sudo", "systemctl", "status", svc))
_, err := s.r.RunCmd(exec.Command("sudo", "systemctl", "is-active", "--quiet", "service", svc))
return err == nil
}