From d7dd45d79b1999a9b50380e848fc71035dd8e3b2 Mon Sep 17 00:00:00 2001 From: "Han Verstraete (OpenFaaS Ltd)" Date: Wed, 14 May 2025 11:49:33 +0200 Subject: [PATCH 1/2] Fix OpenFaaS Edge install script for RHEL-based systems This change removes the check-update command. This command is not required and caused the script to exit early if packages are not up to date. In addition DNF is now used to install packages. DNF is the successor of YUM on the latest RHEL-based systems. Tested on Rocky Linux 8 and 9. Signed-off-by: Han Verstraete (OpenFaaS Ltd) --- hack/install-edge.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/install-edge.sh b/hack/install-edge.sh index 700a9da9..1b9e80e4 100644 --- a/hack/install-edge.sh +++ b/hack/install-edge.sh @@ -13,8 +13,8 @@ if [ "$EUID" -ne 0 ]; then exit fi -has_yum() { - [ -n "$(command -v yum)" ] +has_dnf() { + [ -n "$(command -v dnf)" ] } has_apt_get() { @@ -37,9 +37,8 @@ install_required_packages() { # reference: https://github.com/openfaas/faasd/pull/237 apt-get update -yq apt-get install -yq curl runc bridge-utils iptables iptables-persistent - elif $(has_yum); then - yum check-update -y - yum install -y curl runc iptables-services which + elif $(has_dnf); then + dnf install -y curl runc iptables-services which elif $(has_pacman); then pacman -Syy pacman -Sy curl runc bridge-utils @@ -60,6 +59,7 @@ if [ -z "$SKIP_OS" ]; then install_required_packages fi +echo "" echo "2. Downloading OCI image, and installing pre-requisites" echo "" if [ ! -x "$(command -v arkade)" ]; then From 513b4379e5dfdf52676b11a9e3bb4821e33f2f25 Mon Sep 17 00:00:00 2001 From: "Han Verstraete (OpenFaaS Ltd)" Date: Wed, 14 May 2025 12:58:30 +0200 Subject: [PATCH 2/2] Use full faasd binary path in instructions on RHEL On RHEL systems the installation path of faasd, /usr/local/bin, is not in the sudo PATH by default. Use the full path to the faasd binary in any printed instruction to work around this. Signed-off-by: Han Verstraete (OpenFaaS Ltd) --- hack/install-edge.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hack/install-edge.sh b/hack/install-edge.sh index 1b9e80e4..87fc5b3c 100644 --- a/hack/install-edge.sh +++ b/hack/install-edge.sh @@ -95,6 +95,17 @@ ${BINLOCATION}arkade oci install --path ${tmpdir} \ cd ${tmpdir} ./install.sh ./ +if has_dnf; then + isRhelLike=true +else + isRhelLike=false +fi + +binaryName="faasd" +if [ "$isRhelLike" = true ]; then + binaryName="/usr/local/bin/faasd" +fi + echo "" echo "3.1 Commercial users can create their license key as follows:" echo "" @@ -103,12 +114,12 @@ echo "sudo nano /var/lib/faasd/secrets/openfaas_license" echo "" echo "3.2 For personal, non-commercial use only, GitHub Sponsors of @openfaas (25USD+) can run:" echo "" -echo "sudo -E faasd github login" -echo "sudo -E faasd activate" +echo "sudo -E ${binaryName} github login" +echo "sudo -E ${binaryName} activate" echo "" echo "4. Then perform the final installation steps" echo "" -echo "sudo -E sh -c \"cd ${tmpdir}/var/lib/faasd && faasd install\"" +echo "sudo -E sh -c \"cd ${tmpdir}/var/lib/faasd && ${binaryName} install\"" echo "" echo "5. Refer to the complete handbook and supplementary documentation at:" echo ""