Skip to content

Commit

Permalink
preflight: Add warning when socket activation is not configured
Browse files Browse the repository at this point in the history
In such cases, 'crc daemon' must be run manually, so this warning will
try to inform the user about this.

This could be improved some more as after this commit, the output will be:

INFO systemd user is unsupported
INFO Checking if running as non-root
INFO Checking if running inside WSL2
INFO Checking if crc-admin-helper executable is cached
INFO Checking for obsolete admin-helper executable
INFO Checking if running on a supported CPU architecture
INFO Checking minimum RAM requirements
INFO Checking if crc executable symlink exists
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if active user/process is currently part of the libvirt group
INFO Checking if libvirt daemon is running
INFO Checking if a supported libvirt version is installed
INFO Checking if crc-driver-libvirt is installed
INFO Checking if crc daemon will be autostarted
WARN systemd --user is not available, crc daemon won't be autostarted and must be run manually before using CodeReady Containers
INFO Checking if vsock is correctly configured
INFO Setting up vsock support
INFO Using root access: Setting CAP_NET_BIND_SERVICE capability for /home/teuf/crc executable
INFO Using root access: Creating udev rule for /dev/vsock
INFO Using root access: Changing permissions for /etc/udev/rules.d/99-crc-vsock.rules to 644
INFO Using root access: Reloading udev rules database
INFO Using root access: Loading vhost_vsock kernel module
INFO Using root access: Creating file /etc/modules-load.d/vhost_vsock.conf
INFO Using root access: Changing permissions for /etc/modules-load.d/vhost_vsock.conf to 644
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
Your system is correctly setup for using CodeReady Containers, you can now run 'crc start -b $bundlename' to start the OpenShift cluster
  • Loading branch information
cfergeau authored and praveenkumar committed Sep 1, 2021
1 parent 14313a0 commit 6f85879
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/crc/preflight/preflight_checks_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@ func removeDaemonSystemdService() error {
return nil
}

func warnNoDaemonAutostart() error {
// only purpose of this check is to trigger a warning for RHEL7/CentOS7 users
logging.Warnf("systemd --user is not available, crc daemon won't be autostarted and must be run manually before using CodeReady Containers")
return nil
}

func checkLibvirtServiceRunning() error {
logging.Debug("Checking if libvirtd service is running")
sd := systemd.NewHostSystemdCommander()
Expand Down
6 changes: 6 additions & 0 deletions pkg/crc/preflight/preflight_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ func libvirtPreflightChecks(distro *linux.OsRelease) []Check {

labels: labels{Os: Linux, SystemdUser: Supported},
},
{
checkDescription: "Checking if crc daemon will be autostarted",
check: warnNoDaemonAutostart,

labels: labels{Os: Linux, NetworkMode: User, SystemdUser: Unsupported},
},
}
return checks
}
Expand Down

0 comments on commit 6f85879

Please sign in to comment.