From 6f8587988effc747dac56754b540e25c580a5846 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 30 Aug 2021 17:33:42 +0200 Subject: [PATCH] preflight: Add warning when socket activation is not configured 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 --- pkg/crc/preflight/preflight_checks_linux.go | 6 ++++++ pkg/crc/preflight/preflight_linux.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/pkg/crc/preflight/preflight_checks_linux.go b/pkg/crc/preflight/preflight_checks_linux.go index 18282afd6b..117d23c2a6 100644 --- a/pkg/crc/preflight/preflight_checks_linux.go +++ b/pkg/crc/preflight/preflight_checks_linux.go @@ -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() diff --git a/pkg/crc/preflight/preflight_linux.go b/pkg/crc/preflight/preflight_linux.go index c40199e181..6db5108fb5 100644 --- a/pkg/crc/preflight/preflight_linux.go +++ b/pkg/crc/preflight/preflight_linux.go @@ -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 }