Skip to content

Commit

Permalink
update initial install routine in 123.09beta01
Browse files Browse the repository at this point in the history
- ensure cmake3 is installed earlier in the initial Centmin Mod install routine
- for <=1GB memory servers, re-create a 1GB /swapfile if swap file already exists but is less than 512MB in size
  • Loading branch information
centminmod committed Nov 29, 2021
1 parent 1d2580f commit 6610eca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion centmin-cli.sh
Expand Up @@ -27,7 +27,7 @@ DT=$(date +"%d%m%y-%H%M%S")
branchname='123.09beta01'
SCRIPT_MAJORVER='1.2.3'
SCRIPT_MINORVER='09'
SCRIPT_INCREMENTVER='747'
SCRIPT_INCREMENTVER='748'
SCRIPT_VERSIONSHORT="${branchname}"
SCRIPT_VERSION="${SCRIPT_VERSIONSHORT}.b${SCRIPT_INCREMENTVER}"
SCRIPT_DATE='30/06/2021'
Expand Down
2 changes: 1 addition & 1 deletion centmin.sh
Expand Up @@ -27,7 +27,7 @@ DT=$(date +"%d%m%y-%H%M%S")
branchname='123.09beta01'
SCRIPT_MAJORVER='1.2.3'
SCRIPT_MINORVER='09'
SCRIPT_INCREMENTVER='747'
SCRIPT_INCREMENTVER='748'
SCRIPT_VERSIONSHORT="${branchname}"
SCRIPT_VERSION="${SCRIPT_VERSIONSHORT}.b${SCRIPT_INCREMENTVER}"
SCRIPT_DATE='30/06/2021'
Expand Down
37 changes: 30 additions & 7 deletions inc/centoscheck.inc
Expand Up @@ -88,17 +88,40 @@ sshdtweaks
else
fallocate -l 1G /swapfile
fi
ls -lah /swapfile;
mkswap /swapfile;
swapon /swapfile;
chown root:root /swapfile;
chmod 0600 /swapfile;
swapon -s;
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab;
ls -lah /swapfile;
mkswap /swapfile;
swapon /swapfile;
chown root:root /swapfile;
chmod 0600 /swapfile;
swapon -s;
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab;
mount -a;
free -m
echo
} 2>&1 | tee "${CENTMINLOGDIR}/centminmod_swapsetup_${DT}.log"
elif [[ "$FINDSWAPSIZE" -eq '0' && ! -f /proc/user_beancounters && "$CHECK_LXD" != [yY] && -f /swapfile && "$(grep '/swapfile' /etc/fstab)" ]] || [[ "$(awk '/MemTotal/ {print $2}' /proc/meminfo)" -le '1048576' && "$FINDSWAPSIZE" -le '512' && ! -f /proc/user_beancounters && "$CHECK_LXD" != [yY] && -f /swapfile && "$(grep '/swapfile' /etc/fstab)" ]]; then
{
echo
free -mlt
echo
echo "re-create 1GB swap file";
swapoff -a
if [[ "$(df -hT | grep -w xfs)" || "$(virt-what | grep -o lxc)" = 'lxc' ]]; then
dd if=/dev/zero of=/swapfile bs=1024 count=1024k;
else
fallocate -l 1G /swapfile
fi
ls -lah /swapfile;
mkswap /swapfile;
swapon /swapfile;
chown root:root /swapfile;
chmod 0600 /swapfile;
swapon -s;
# echo "/swapfile swap swap defaults 0 0" >> /etc/fstab;
mount -a;
free -mlt
echo
} 2>&1 | tee "${CENTMINLOGDIR}/centminmod_swapsetup_${DT}.log"
fi

if [ ! -f /etc/ld.so.preload ]; then
Expand Down
2 changes: 1 addition & 1 deletion inc/downloads_centosseven.inc
Expand Up @@ -354,7 +354,7 @@ if [[ "$(uname -m)" != 'aarch64' ]]; then
fi

# CentOS 7 repo mirrors aren't fully updated so need to specify actual kernel-headers version
PACKAGEEXTRA='oniguruma5php oniguruma5php-devel figlet moreutils nghttp2 libnghttp2 libnghttp2-devel jq clang clang-devel jemalloc jemalloc-devel pngquant optipng jpegoptim pwgen pigz pbzip2 xz pxz lz4 uw-imap-devel libtidy libtidy-devel libJudy axel bash-completion bash-completion-extras mlocate re2c libmcrypt libmcrypt-devel kernel-headers kernel-devel cmake28'
PACKAGEEXTRA='oniguruma5php oniguruma5php-devel figlet moreutils nghttp2 libnghttp2 libnghttp2-devel jq clang clang-devel jemalloc jemalloc-devel pngquant optipng jpegoptim pwgen pigz pbzip2 xz pxz lz4 uw-imap-devel libtidy libtidy-devel libJudy axel bash-completion bash-completion-extras mlocate re2c libmcrypt libmcrypt-devel kernel-headers kernel-devel cmake28 cmake3'

declare -a arrays
arrays=(${PACKAGEEXTRA})
Expand Down

0 comments on commit 6610eca

Please sign in to comment.