Skip to content

Commit 2138692

Browse files
cfergeaupraveenkumar
authored andcommitted
preflight: Warn when libvirtd is not running
CodeReady Containers assumes libvirtd to be auto started at boot time, or at least to be running when `crc start` is called. The code to automatically enable libvirtd has been removed as it's quite complicated to do automatically, and indicates that the system has been manually modified by the user. This commit adds a warning to let the user know some extra configuration steps may be needed.
1 parent 884a19b commit 2138692

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/crc/preflight/preflight_checks_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ func checkLibvirtServiceRunning() error {
185185
}
186186
stdOut, _, err := crcos.RunWithDefaultLocale(path, "is-active", "libvirtd")
187187
if err != nil {
188+
logging.Warnf("No active (running) libvirtd systemd unit could be found - make sure one of libvirt systemd unit could be found - make sure one of libvirt systemd units is enabled so that it's autostarted at boot time.")
188189
return fmt.Errorf("Failed to check if libvirtd service is active")
189190
}
190191
if strings.TrimSpace(stdOut) != "active" {
192+
logging.Warnf("No active (running) libvirtd systemd unit could be found - make sure one of libvirt systemd unit could be found - make sure one of libvirt systemd units is enabled so that it's autostarted at boot time.")
191193
return fmt.Errorf("libvirtd.service is not running")
192194
}
193195
logging.Debug("libvirtd.service is already running")

0 commit comments

Comments
 (0)