Skip to content

Commit

Permalink
Enable and start vsock and http crc sockets
Browse files Browse the repository at this point in the history
This patch fix the scenario when a user try to reboot the host
and try to run `crc start` on an already configured host. Without
this patch user observes following error during `crc start`.
```
INFO Checking crc daemon systemd socket units
WARN Preflight checks failed during `crc start`, please try to run `crc setup` first in case you haven't done so yet
```

It happen because systemd service is not enabled by the `crc setup`
command.

fixes: #2739
  • Loading branch information
praveenkumar committed Sep 22, 2021
1 parent 270faa2 commit 7e12e6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/crc/preflight/preflight_checks_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ func fixSystemdUnit(unitName string, unitContent string, shouldBeRunning bool) e
running := systemdUnitRunning(sd, unitName)
if !running && shouldBeRunning {
logging.Debugf("Starting %s", unitName)
if err := sd.Enable(unitName); err != nil {
return err
}
return sd.Start(unitName)
} else if running && !shouldBeRunning {
logging.Debugf("Stopping %s", unitName)
Expand Down

0 comments on commit 7e12e6c

Please sign in to comment.