disable minikube-scheduled-stop.service until a user schedules a stop
parent
413cdf6e5b
commit
1921801b69
|
@ -8,10 +8,6 @@ define SCHEDULED_STOP_INSTALL_INIT_SYSTEMD
|
|||
$(INSTALL) -D -m 644 \
|
||||
$(SCHEDULED_STOP_PKGDIR)/minikube-scheduled-stop.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/minikube-scheduled-stop.service
|
||||
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service
|
||||
endef
|
||||
|
||||
define SCHEDULED_STOP_INSTALL_TARGET_CMDS
|
||||
|
|
|
@ -155,9 +155,7 @@ RUN ln -fs /usr/lib/systemd/system/minikube-automount.service \
|
|||
# scheduled stop service
|
||||
COPY scheduled-stop/minikube-scheduled-stop /var/lib/minikube/scheduled-stop/minikube-scheduled-stop
|
||||
COPY scheduled-stop/minikube-scheduled-stop.service /usr/lib/systemd/system/minikube-scheduled-stop.service
|
||||
RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \
|
||||
/etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service && \
|
||||
chmod +x /var/lib/minikube/scheduled-stop/minikube-scheduled-stop
|
||||
RUN chmod +x /var/lib/minikube/scheduled-stop/minikube-scheduled-stop
|
||||
|
||||
# disable non-docker runtimes by default
|
||||
RUN systemctl disable containerd && systemctl disable crio && rm /etc/crictl.yaml
|
||||
|
|
|
@ -100,8 +100,12 @@ func startSystemdService(profile string, duration time.Duration) error {
|
|||
return errors.Wrap(err, "copying scheduled stop env file")
|
||||
}
|
||||
// restart scheduled stop service in container
|
||||
sysManger := sysinit.New(runner)
|
||||
return sysManger.Restart(constants.ScheduledStopSystemdService)
|
||||
sysManager := sysinit.New(runner)
|
||||
// enable scheduled stop service
|
||||
if err := sysManager.Enable(constants.ScheduledStopSystemdService); err != nil {
|
||||
return err
|
||||
}
|
||||
return sysManager.Restart(constants.ScheduledStopSystemdService)
|
||||
}
|
||||
|
||||
// return the contents of the environment file for minikube-scheduled-stop systemd service
|
||||
|
|
Loading…
Reference in New Issue