Browse Source

refactor(check): deprecate glibc fixes (#2118)

* glibc fixes only fixes 15 out of 85 servers with only centos 6 still supported by vendors. It has been decided to remove support for glibc fixes
pull/2123/head
Daniel Gibbs 6 years ago
committed by GitHub
parent
commit
e7df8b6a6e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 37
      lgsm/functions/check_glibc.sh
  2. 12
      lgsm/functions/command_debug.sh
  3. 12
      lgsm/functions/command_dev_detect_glibc.sh
  4. 6
      lgsm/functions/core_functions.sh
  5. 69
      lgsm/functions/fix_glibc.sh
  6. 2
      lgsm/functions/info_glibc.sh
  7. 16
      lgsm/functions/info_messages.sh

37
lgsm/functions/check_glibc.sh

@ -11,31 +11,14 @@ info_distro.sh
if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
:
elif [ "${glibcrequired}" == "UNKNOWN" ]; then
fn_print_dots "Glibc fix"
sleep 0.5
fn_print_error_nl "Glibc fix: ${red}${glibcrequired}${default}"
echo -e " * glibc required: ${red}${glibcrequired}${default}"
echo -e " * glibc installed: ${glibcversion}"
elif [ "$(printf '%s\n'${glibcrequired}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]; then
if [ "${glibcfix}" == "yes" ]; then
if [ "${function_selfname}" != "command_install.sh" ]; then
fn_print_dots "Glibc fix"
sleep 0.5
fn_print_info_nl "Glibc fix: ${green}Using Glibc fix${default}"
echo -e " * glibc required: ${red}${glibcrequired}${default}"
echo -e " * glibc installed: ${glibcversion}"
fix_glibc.sh
fi
else
fn_print_dots "Glibc fix"
sleep 0.5
fn_print_error_nl "Glibc fix: ${red}No Glibc fix available!${default}"
echo -en "\n"
echo -e " * glibc required: ${glibcrequired}"
echo -e " * glibc installed: ${red}${glibcversion}${default}"
echo -en "\n"
fn_print_information "The game server will probably not work. A distro upgrade is required!"
sleep 2
fi
elif [ "$(printf '%s\n'${glibcrequired}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]||[ "${glibcrequired}" == "UNKNOWN" ]; then
fn_print_dots "Glibc"
sleep 0.5
fn_print_error_nl "glibc: ${red}glibc distro version ${glibcversion} too old${default}"
echo -en "\n"
echo -e " * glibc required: ${glibcrequired}"
echo -e " * glibc installed: ${red}${glibcversion}${default}"
echo -en "\n"
fn_print_information "The game server will probably not work. A distro upgrade is required!"
sleep 2
fi

12
lgsm/functions/command_debug.sh

@ -34,20 +34,16 @@ echo -e "${blue}tmux:\t${default}${tmuxv}"
echo -e "${blue}Avg Load:\t${default}${load}"
echo -e "${blue}Free Memory:\t${default}${physmemfree}"
echo -e "${blue}Free Disk:\t${default}${availspace}"
# GLIBC required
# glibc required
if [ -n "${glibcrequired}" ]; then
if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
:
elif [ "${glibcrequired}" == "UNKNOWN" ]; then
echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
echo -e "${blue}glibc required:\t${red}${glibcrequired}"
elif [ "$(printf '%s\n'${glibcrequired}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]; then
if [ "${glibcfix}" == "yes" ]; then
echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
else
echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC distro version ${glibcversion} too old${default})"
fi
echo -e "${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})"
else
echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
echo -e "${blue}glibc required:\t${green}${glibcrequired}${default}"
fi
fi
# Server ip

12
lgsm/functions/command_dev_detect_glibc.sh

@ -10,7 +10,7 @@ local commandaction="Detect-Glibc"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "================================="
echo "GLIBC Requirements Checker"
echo "glibc Requirements Checker"
echo "================================="
if [ -z "$(command -v objdump)" ]; then
@ -58,10 +58,10 @@ do
done
echo ""
echo ""
echo "${glibc_check_name} GLIBC Requirements"
echo "${glibc_check_name} glibc Requirements"
echo "================================="
if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then
echo "Required GLIBC"
echo "Required glibc"
cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 |tee -a "${tmpdir}/detect_glibc_highest.tmp"
echo ""
echo "Files requiring GLIBC"
@ -73,19 +73,19 @@ do
rm "${tmpdir}/detect_glibc_${glibc_check_var}.tmp"
rm "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"
else
fn_print_information_nl "GLIBC is not required"
fn_print_information_nl "glibc is not required"
fi
else
fn_print_information_nl "${glibc_check_name} is not installed"
fi
done
echo ""
echo "Final GLIBC Requirement"
echo "Final glibc Requirement"
echo "================================="
if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then
cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1
rm "${tmpdir}/detect_glibc_highest.tmp"
else
fn_print_information_nl "GLIBC is not required"
fn_print_information_nl "glibc is not required"
fi
core_exit.sh

6
lgsm/functions/core_functions.sh

@ -322,12 +322,6 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
fix_glibc.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
fix_kf.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function

69
lgsm/functions/fix_glibc.sh

@ -1,69 +0,0 @@
#!/bin/bash
# LinuxGSM fix_glibc.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Downloads required Glibc files and applies the Glibc fix if required.
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
## i386
# libstdc++.so.6
local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Counter-Strike: Global Offensive" "Garry's Mod" "GoldenEye: Source" "Just Cause 2" "Team Fortress 2" )
for libstdc_server in "${libstdc_servers_array[@]}"
do
if [ "${gamename}" == "${libstdc_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libstdc++.so.6" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
# libm.so.6
local libm_servers_array=( "Black Mesa: Deathmatch" "Codename CURE" "Day of Infamy" "Double Action: Boogaloo" "Empires Mod" "Fistful of Frags" "Garry's Mod" "GoldenEye: Source" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" "Pirates, Vikings, and Knights II" "Team Fortress 2" )
for libm_server in "${libm_servers_array[@]}"
do
if [ "${gamename}" == "${libm_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libm.so.6" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
# libc.so.6
local libc_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" "GoldenEye: Source" "Team Fortress 2" )
for libc_server in "${libc_servers_array[@]}"
do
if [ "${gamename}" == "${libc_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libc.so.6" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
# libpthread.so.0
local libpthread_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" )
for libpthread_server in "${libpthread_servers_array[@]}"
do
if [ "${gamename}" == "${libpthread_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libpthread.so.0" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
## amd64
# libm.so.6
local libm_servers_array=( "Factorio" )
for libm_server in "${libm_servers_array[@]}"
do
if [ "${gamename}" == "${libm_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/amd64" "libm.so.6" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
# libc.so.6
local libc_servers_array=( "Factorio" )
for libc_server in "${libc_servers_array[@]}"
do
if [ "${gamename}" == "${libc_server}" ]; then
fn_fetch_file_github "lgsm/lib/ubuntu12.04/amd64" "libc.so.6" "${lgsmdir}/lib" "nochmodx" "norun" "noforce" "nomd5"
fi
done
export LD_LIBRARY_PATH=:"${libdir}"

2
lgsm/functions/info_glibc.sh

@ -212,7 +212,7 @@ else
glibcfix="no"
fi
# Sets the SteamCMD GLIBC requirement if the game server requirement is less or not required.
# Sets the SteamCMD glibc requirement if the game server requirement is less or not required.
if [ -n "${appid}" ]; then
if [ "${glibcrequired}" = "NOT REQUIRED" ]||[ -z "${glibcrequired}" ]||[ "$(printf '%s\n'${glibcrequired}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then
glibcrequired="2.14"

16
lgsm/functions/info_messages.sh

@ -40,7 +40,7 @@ fn_info_message_distro(){
# Kernel: 3.13.0-79-generic
# Hostname: hostname
# tmux: tmux 1.8
# GLIBC: 2.19
# glibc: 2.19
echo -e ""
echo -e "${lightyellow}Distro Details${default}"
@ -51,7 +51,7 @@ fn_info_message_distro(){
echo -e "${blue}Kernel:\t${default}${kernel}"
echo -e "${blue}Hostname:\t${default}${HOSTNAME}"
echo -e "${blue}tmux:\t${default}${tmuxv}"
echo -e "${blue}GLIBC:\t${default}${glibcversion}"
echo -e "${blue}glibc:\t${default}${glibcversion}"
} | column -s $'\t' -t
}
@ -362,20 +362,16 @@ fn_info_message_script(){
# User
echo -e "${blue}User:\t${default}$(whoami)"
# GLIBC required
# glibc required
if [ -n "${glibcrequired}" ]; then
if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
:
elif [ "${glibcrequired}" == "UNKNOWN" ]; then
echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
echo -e "${blue}glibc required:\t${red}${glibcrequired}"
elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
if [ "${glibcfix}" == "yes" ]; then
echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
else
echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
fi
echo -e "${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})"
else
echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
echo -e "${blue}glibc required:\t${green}${glibcrequired}${default}"
fi
fi

Loading…
Cancel
Save