From 4f09fb32bb2ed4fae4c84d659fc88bc087093370 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sun, 5 Jan 2020 04:14:41 -0600 Subject: [PATCH 1/6] CentOS 8 support, maybe --- virtualmin-install.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index 2b77db3..9f02d30 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -22,7 +22,7 @@ VER=6.0.20 vm_version=6 # Currently supported systems: -supported=" CentOS/RHEL Linux 6 and 7 on x86_64 +supported=" CentOS/RHEL Linux 6, 7, and 8 on x86_64 Debian 8, 9, and 10 on i386 and amd64 Ubuntu 16.04 LTS and 18.04 LTS on i386 and amd64" @@ -268,7 +268,7 @@ fi # XXX: This check is imperfect. If $TMPDIR is a full path, but the parent dir # is mounted noexec, this won't catch it. TMPNOEXEC="$(grep $TMPDIR /etc/mtab | grep noexec)" -if [ ! -z "$TMPNOEXEC" ]; then +if [ -n "$TMPNOEXEC" ]; then echo "${RED}Fatal:${NORMAL} $TMPDIR directory is mounted noexec. Installation cannot continue." exit 1 fi @@ -568,7 +568,7 @@ fi log_info "Started installation log in $log" echo -if [ ! -z $setup_only ]; then +if [ -n "$setup_only" ]; then log_debug "Phase 1 of 1: Setup" printf "${YELLOW}▣${NORMAL} Phase ${YELLOW}1${NORMAL} of ${GREEN}1${NORMAL}: Setup\\n" else @@ -584,7 +584,7 @@ log_debug "install.sh version: $VER" # Check for a fully qualified hostname log_debug "Checking for fully qualified hostname..." name="$(hostname -f)" -if [ ! -z "$forcehostname" ]; then set_hostname "$forcehostname" +if [ -n "$forcehostname" ]; then set_hostname "$forcehostname" elif ! is_fully_qualified "$name"; then set_hostname fi @@ -648,6 +648,7 @@ install_virtualmin_release () { install="dnf -y install" install_cmd="dnf" install_group="dnf -y --quiet group install --setopt=group_package_types=mandatory,default" + install_config_manager="dnf config-manager" else install="/usr/bin/yum -y install" install_cmd="/usr/bin/yum" @@ -655,6 +656,7 @@ install_virtualmin_release () { run_ok "yum --quiet groups mark convert" "Updating yum Groups" fi install_group="yum -y --quiet groupinstall --setopt=group_package_types=mandatory,default" + install_config_manager="yum-config-manager" fi download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm" run_ok "rpm -U --replacepkgs --quiet virtualmin-release-latest.noarch.rpm" "Installing virtualmin-release package" @@ -741,7 +743,7 @@ esac return 0 } -if [ ! -z "$setup_only" ]; then +if [ -n "$setup_only" ]; then if install_virtualmin_release; then log_success "Repository configuration successful. You can now install Virtualmin" log_success "components using your OS package manager." @@ -802,8 +804,13 @@ install_with_yum () { install_scl_php fi + # Some important packages are now hidden in PowerTools repo + if [ "$os_major_version" -eq 8 ]; then + run_ok "$install_config_manager --set-enabled PowerTools" "Enabling PowerTools package repository" + fi + # XXX This is so stupid. Why does yum insist on extra commands? - if [ "$os_major_version" -ge 7 ]; then + if [ "$os_major_version" -eq 7 ]; then run_ok "yum --quiet groups mark install $rhgroup" "Marking $rhgroup for install" run_ok "yum --quiet groups mark install $vmgroup" "Marking $vmgroup for install" fi @@ -848,13 +855,12 @@ install_epel_release () { install_scl_php () { if [ -z "$DISABLE_SCL" ]; then run_ok "$install yum-utils" "Installing yum-utils" - run_ok "yum-config-manager --enable extras >/dev/null" "Enabling extras repository" + run_ok "$install_config_manager --enable extras >/dev/null" "Enabling extras repository" run_ok "$install scl-utils" "Installing scl-utils" if [ "${os_type}" = "centos" ]; then run_ok "$install centos-release-scl" "Install Software Collections release package" elif [ "${os_type}" = "rhel" ]; then - # XXX Fix this for dnf (dnf config-manager, instead of yum-config-manager) - run_ok "yum-config-manager --enable rhel-server-rhscl-${os_major_version}-rpms" "Enabling Server Software Collection" + run_ok "$install_config_manager --enable rhel-server-rhscl-${os_major_version}-rpms" "Enabling Server Software Collection" fi run_ok "$install_group $sclgroup" "Installing PHP7" fi @@ -938,7 +944,7 @@ else log_error "Could not safely clean up temporary files because TMPDIR set to $tempdir." fi -if [ ! -z "$QUOTA_FAILED" ]; then +if [ -n "$QUOTA_FAILED" ]; then log_warning "Quotas were not configurable. A reboot may be required. Or, if this is" log_warning "a VM, configuration may be required at the host level." fi From ecf79b703f41302ff8ee77195819a03fcf28ae6f Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sun, 5 Jan 2020 04:38:39 -0600 Subject: [PATCH 2/6] No SCL on CentOS 8 --- virtualmin-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index 9f02d30..f68bab2 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -801,7 +801,10 @@ install_with_yum () { # install extras from EPEL and SCL if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ]; then install_epel_release - install_scl_php + if [ "$os_major_version" -lt 8 ]; then + # No SCL on CentOS 8 + install_scl_php + fi fi # Some important packages are now hidden in PowerTools repo From c4c6e6633276fd6920765dcd62331b4dfe1dddd0 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sun, 5 Jan 2020 04:58:34 -0600 Subject: [PATCH 3/6] Import Webmin GPG key explicitly --- virtualmin-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index f68bab2..c79f5d7 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -660,6 +660,9 @@ install_virtualmin_release () { fi download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm" run_ok "rpm -U --replacepkgs --quiet virtualmin-release-latest.noarch.rpm" "Installing virtualmin-release package" + # XXX This weirdly only seems necessary on CentOS 8, but harmless + # elsewhere. + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-webmin ;; debian | ubuntu) package_type="deb" From 1247079e29f20a677b672717fc90b6dfe780f114 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Mon, 6 Jan 2020 00:07:38 -0600 Subject: [PATCH 4/6] Typo --- virtualmin-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index c79f5d7..b23dd29 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -431,7 +431,7 @@ case "$package_type" in esac echo 'Removing nameserver 127.0.0.1 from /etc/resolv.conf' sed -i '/nameserver 127.0.0.1/g' /etc/resolv.conf -echoo 'Removing virtualmin repo configuration' +echo 'Removing virtualmin repo configuration' remove_virtualmin_release echo "Removing /etc/virtualmin-license, if it exists." rm /etc/virtualmin-license From 441ae67b45e28b6f1bfdf9fffbf0ac532a88ea4b Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sat, 18 Jan 2020 22:28:01 -0600 Subject: [PATCH 5/6] Increase minimum RAM sizes and force bigger swap --- virtualmin-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index b23dd29..bcd0ab6 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -18,7 +18,7 @@ # License and version SERIAL=GPL KEY=GPL -VER=6.0.20 +VER=6.1.1 vm_version=6 # Currently supported systems: @@ -518,10 +518,10 @@ fi # Check memory if [ "$mode" = "full" ]; then - minimum_memory=1048576 + minimum_memory=1610613 else # minimal mode probably needs less memory to succeed - minimum_memory=786432 + minimum_memory=1048576 fi if ! memory_ok "$minimum_memory"; then log_fatal "Too little memory, and unable to create a swap file. Consider adding swap" From 14135ad753ead123d15d7b9d8f38d3d4e3fabf51 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sat, 18 Jan 2020 22:38:30 -0600 Subject: [PATCH 6/6] Try to fix Travis build failures due to no old perl --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dd9ba82..2973be3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq perl shellcheck devscripts