Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix stale hyperkit.pid making minikube start hang #3593

Merged
merged 5 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting / removed extra comment
  • Loading branch information
balopat committed Jan 28, 2019
commit 5af2f1eafc7a5d00238d05637682bf4264343497
11 changes: 6 additions & 5 deletions pkg/drivers/hyperkit/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package hyperkit
import (
"encoding/json"
"fmt"
"github.com/mitchellh/go-ps"
"os"
"os/user"
"path"
Expand All @@ -31,13 +30,16 @@ import (
"syscall"
"time"

"github.com/mitchellh/go-ps"

"io/ioutil"

"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/state"
"github.com/johanneswuerbach/nfsexports"
"github.com/moby/hyperkit/go"
"github.com/pkg/errors"
"io/ioutil"
pkgdrivers "k8s.io/minikube/pkg/drivers"
"k8s.io/minikube/pkg/minikube/constants"
commonutil "k8s.io/minikube/pkg/util"
Expand Down Expand Up @@ -268,13 +270,12 @@ func (d *Driver) recoverFromUncleanShutdown() error {
}

log.Warnf("minikube might have been shutdown in an unclean way, the hyperkit pid file still exists: %s", pidFile)
// we have a pid file, hyperkit might be running!
// Make sure the pid written by hyperkit is the same as in the json

content, err := ioutil.ReadFile(pidFile)
balopat marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return errors.Wrapf(err, "reading pidfile %s", pidFile)
}
pid, err := strconv.Atoi(string(content[:]))
pid, err := strconv.Atoi(string(content))
if err != nil {
return errors.Wrapf(err, "parsing pidfile %s", pidFile)
}
Expand Down