import sapconf-0.99-4.el8_2

This commit is contained in:
CentOS Sources 2020-09-08 04:42:01 -04:00 committed by Stepan Oksanichenko
parent 5164e3229e
commit 5dbea622df
27 changed files with 109 additions and 820 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/sapconf-0.98.tar.bz2 SOURCES/sapconf-0.99.tar.xz

View File

@ -1 +1 @@
082fc8c7a555c4e12f7b222011a3f9042b97408c SOURCES/sapconf-0.98.tar.bz2 4d3f91b7a6344864c3fd9e5bb99f1bba647a6e2a SOURCES/sapconf-0.99.tar.xz

View File

@ -0,0 +1,13 @@
--- sapconf-0.99/sapconf-0.99-#11701246-function-check_links 2019-05-21 14:32:24.208136774 +0100
+++ sapconf-0.99/sapconf 2019-05-21 15:44:01.888215988 +0100
@@ -998,9 +998,9 @@
# disable check_rpms as workaround on rhel 8 according to #1672323
if ( ! grep "release 8" /etc/redhat-release ) ; then
check_rpms
+ check_links
fi
check_uuidd
-check_links
check_chronyd
check_env
for g in $SAPGROUPLIST; do

View File

@ -0,0 +1,14 @@
--- sapconf-0.99/sapconf.me 2019-05-21 13:45:50.318951661 +0100
+++ sapconf-0.99/sapconf 2019-05-21 14:01:03.403549401 +0100
@@ -995,7 +995,10 @@
check_rhn
check_fqdn
check_security
-check_rpms
+# disable check_rpms as workaround on rhel 8 according to #1672323
+if ( ! grep "release 8" /etc/redhat-release ) ; then
+ check_rpms
+fi
check_uuidd
check_links
check_chronyd

View File

@ -0,0 +1,11 @@
--- sapconf-0.99/sapconf-0.99-#1701314-function-check_rhn-does-not-cath-major-release-number 2019-05-21 14:12:39.941651612 +0100
+++ sapconf-0.99/sapconf 2019-05-21 15:44:01.888215988 +0100
@@ -713,7 +713,7 @@
# Checks if system is subscribed to RHEL for SAP Channel
function check_rhn() {
-if yum repolist | egrep -q "rhel-$(uname -m)-server-sap|rhel-sap-for-rhel-$(awk '{print $7}' /etc/redhat-release | cut -c -1)-server(-e4s|-eus)?-rpms"; then
+if yum repolist | egrep "rhel-$(awk '{split($(NF-1), a, "."); print a[1]}' /etc/redhat-release)-for-$(uname -m)-sap-netweaver(-beta|-e4s|-eus)?-rpms" ; then
out "RHEL system subscribed to RHEL for SAP channel ... OK"
else
out "RHEL system not subscribed to RHEL for SAP channel ... WARNING"

View File

@ -0,0 +1,39 @@
diff -up sapconf-0.99/sapconf-0.99-usage-exit-state sapconf-0.99/sapconf
--- sapconf-0.99/sapconf-0.99-usage-exit-state 2019-05-23 17:03:37.889952987 +0200
+++ sapconf-0.99/sapconf 2019-05-23 17:09:21.509034962 +0200
@@ -57,6 +57,8 @@ SAP_NOTE_RHEL7="SAP Note 2002167"
CHECK_ONLY=0
FORCE_MODE=0
QUIET=0
+EXIT_STATE=1
+
# rec_count counts the number of lines of variable array REC[] that contains recommendations to be put at the end of the $LOGFILE
rec_count=0
@@ -115,7 +117,8 @@ ORA_EXTRA_RPMS="@development libaio liba
# called on wrong usage
#
# return codes:
-# 1
+# 0, parameter -h
+# 1, wrong usage
function usage() {
cat << EOU
Usage: $0 [-d <dbtype>] [-f] [-n] [-q]
@@ -127,7 +130,7 @@ Usage: $0 [-d <dbtype>] [-f] [-n] [-q]
-h : help message
EOU
-exit 1
+exit $EXIT_STATE
}
#####################################
@@ -945,6 +948,7 @@ while getopts "c:d:fhnq" opt; do
FORCE_MODE=1
;;
h)
+ EXIT_STATE=0
usage
;;
n)

View File

@ -1,38 +0,0 @@
--- a/sapconf 2014-04-17 17:28:04.000000000 +0200
+++ b/sapconf 2014-10-29 11:33:57.555316594 +0100
@@ -16,7 +16,7 @@
#
#---------------------------------------------------------------------------
#
-# requires: tuned with SAP profile
+# requires: tuned-profiles-sap
#
# options:
# -f <file> : uses the given file instead of /etc/sysconfig/sap (FUTURE USE)
@@ -51,7 +51,7 @@
# rec_count counts the number of lines of variable array REC[] that contains recommendations to be put at the end of the $LOGFILE
rec_count=0
-TUNED_SAP_PROFILE=sap
+TUNED_SAP_PROFILE=sap-netweaver
#####################################
#
@@ -89,7 +89,7 @@
# Define required RPMs
# RPMS contains rpms recommended by SAP Note
-RPMS="@compat-libraries @debugging @directory-client @hardware-monitoring @large-systems @network-file-system-client @perl-runtime @storage-client-multipath @x11 uuidd tuned"
+RPMS="@compat-libraries @debugging @directory-client @hardware-monitoring @large-systems @network-file-system-client @perl-runtime @storage-client-multipath @x11 uuidd tuned-profiles-sap"
# VIRTRPMS is a variable used by function virtrpms and check_rpms. In virtrpms the rpms that are required by SAP on virtual guests will be set in VIRTRPMS, and installed by check_rpms. Currently vm-dump-metrics is installed on KVM/RHEV based guests. XEN and VMware are not implemented.
VIRTRPMS=""
@@ -353,7 +353,7 @@
fi
out "Activating tuned '$TUNED_SAP_PROFILE' profile"
- tuned-adm profile $TUNED_SAP_PROFILE || error "Unable to activate tuned '$TUNED_SAP_RROFILE' profile." 3
+ tuned-adm profile $TUNED_SAP_PROFILE || error "Unable to activate tuned '$TUNED_SAP_PROFILE' profile." 3
fi # [ $CHECK_ONLY == 0 ]
fi #[ $ec -eq 0 ]
}

View File

@ -1,144 +0,0 @@
From 4697e670434d01464723d3f3da6608ea6d650cf2 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Tue, 7 Apr 2015 13:42:15 +0200
Subject: [PATCH 6/6] Add force mode BUG:1205691
---
sapconf | 33 +++++++++++++++++++--------------
sapconf.man | 7 ++++---
2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/sapconf b/sapconf
index 58096fe..bad7736 100755
--- a/sapconf
+++ b/sapconf
@@ -20,10 +20,11 @@
# requires: tuned-profiles-sap
#
# options:
-# -f <file> : uses the given file instead of /etc/sysconfig/sap (FUTURE USE)
-# -n : just check and don't modify
-# -q : quiet, no output
-# -d <dbtyp>: used to set special parameters for Sybase and Oracle
+# -d <dbtyp> : used to set special parameters for Sybase and Oracle, respectively (i.e. sybase|syb|oracle|ora)
+# -f : FORCE mode: do actions which are not required, but makes your life easier (i.e. disable firewall)
+# -n : CHECK_ONLY mode: no modification will be made to the system
+# -q : quiet execution. log file directory: /var/log/sap
+# -h : help message
#
# returncodes:
# 0 : all works well
@@ -53,6 +53,7 @@ export LOGFILE=${LOGDIR}/${SCRIPTNAME}-$(date +"%Y%m%d%H%M").log
SAP_NOTE_RHEL7="SAP Note 2002167"
CHECK_ONLY=0
+FORCE_MODE=0
QUIET=0
# rec_count counts the number of lines of variable array REC[] that contains recommendations to be put at the end of the $LOGFILE
rec_count=0
@@ -115,10 +116,11 @@ ORA_EXTRA_RPMS="@development libaio libaio-devel compat-libstdc++-33 elfutils-li
# 1
function usage() {
cat << EOU
-Usage: $0 [-d <dbtype>] [-n] [-q]
+Usage: $0 [-d <dbtype>] [-f] [-n] [-q]
-d <dbtyp> : used to set special parameters for Sybase and Oracle, respectively (i.e. sybase|syb|oracle|ora)
- -n : CHECK_ONLY mode: check only, no modification will be made to the system
+ -f : FORCE mode: do actions which are not required, but makes your life easier (i.e. disable firewall)
+ -n : CHECK_ONLY mode: no modification will be made to the system
-q : quiet execution. log file directory: /var/log/sap
-h : help message
@@ -639,7 +639,12 @@ function check_security() {
# SELinux needs to be permissive or disabled
SELINUX_CONFIG=/etc/selinux/config
if egrep -q "^SELINUX=['\"]?enforcing" $SELINUX_CONFIG; then
- rec "SELinux is configured to be booted in enforcing mode. It's recommended to set to permissive. Please check $SAP_NOTE_RHEL7 for details."
+ if [ $FORCE_MODE == 1 ]; then
+ sed -i "s/^SELINUX=['\"]\?enforcing/SELINUX=permissive/" $SELINUX_CONFIG
+ out "Configuring SELinux to be permissive..."
+ else
+ rec "SELinux is configured to be booted in enforcing mode. It's recommended to set to permissive. Please check $SAP_NOTE_RHEL7 for details."
+ fi
else
if egrep -q "^SELINUX=['\"]?disabled" $SELINUX_CONFIG; then
rec "SElinux is configured to be disabled on boot. It's recommended to be set to permissive, however your system may then require to be relabeled. Please check $SAP_NOTE_RHEL7 for details."
@@ -655,7 +657,7 @@ fi
# Firewall needs to be off
if systemctl status firewalld.service > /dev/null 2>&1 ; then
- if [ $CHECK_ONLY == 0 ]; then
+ if [ $FORCE_MODE == 1 ]; then
# disable firewall or open required ports
systemctl disable firewalld.service > /dev/null 2>&1
systemctl stop firewalld.service > /dev/null 2>&1
@@ -905,18 +907,9 @@ done
#
####################################################################################
-while getopts "nqhf:d:" opt; do
+while getopts "c:d:fhnq" opt; do
case $opt in
- n)
- CHECK_ONLY=1
- ;;
- q)
- QUIET=1
- ;;
- h)
- usage
- ;;
- f)
+ c)
SAPCONFIG=$OPTARG
[ ! -r $SAPCONFIG ] && error "File $SAPCONFIG does not exist" 2
. $SAPCONFIG
@@ -924,6 +917,18 @@ while getopts "nqhf:d:" opt; do
d)
dbtyp=$OPTARG
;;
+ f)
+ FORCE_MODE=1
+ ;;
+ h)
+ usage
+ ;;
+ n)
+ CHECK_ONLY=1
+ ;;
+ q)
+ QUIET=1
+ ;;
*)
usage
;;
diff --git a/sapconf.man b/sapconf.man
index 0d49cdf..57e50fd 100644
--- a/sapconf.man
+++ b/sapconf.man
@@ -4,7 +4,7 @@
.SH NAME
sapconf \- prepares fresh installed RHEL for installation of SAP
.SH SYNOPSIS
-sapconf [-d <dbtype>] [-n] [-q]
+sapconf [-d <dbtype>] [-f] [-n] [-q]
.SH DESCRIPTION
sapconf is a shell program for configuring/checking a Red Hat Enterprise Linux system according to the follwing SAP Notes:
@@ -21,9 +21,10 @@ SE Linux status will only be checked.
.SH OPTIONS
- -n : CHECK_ONLY mode: check only, no modification will be made to the system
+ -d <dbtyp> : used to set special parameters for Sybase and Oracle, respectively (i.e. sybase|syb|oracle|ora)
+ -f : FORCE mode: do actions which are not required, but makes your life easier (i.e. disable firewall)
+ -n : CHECK_ONLY mode: no modification will be made to the system
-q : quiet execution. log file directory: /var/log/sap
- -d <dbtype> : used to set special parameters for Sybase and Oracle, respectively (i.e. sybase|syb|oracle|ora|db2|ada)
-h : help message
.\.SH SEE ALSO
--
2.1.0

View File

@ -1,14 +0,0 @@
diff --git a/sapconf.man b/sapconf.man
index 0f004f3..0d49cdf 100644
--- a/sapconf.man
+++ b/sapconf.man
@@ -15,7 +15,8 @@ sapconf is a shell program for configuring/checking a Red Hat Enterprise Linux s
SAP Note 611361 — hostname length
SAP Note 1631106 — RHEL for SAP Business Applications
-Information will be printed if system is virtualized on Xen or VMware.
+Information will be printed if system is virtualized on XEN, KVM, RHEV or VMware. On VMs running on KVM it will install the
+vm-dump-metrics tool required by the SAP monitoring infrastructure.
SE Linux status will only be checked.
.SH OPTIONS

View File

@ -1,38 +0,0 @@
From 7726f121d2693025ae46f3047d7734c0d03942ad Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Tue, 3 Feb 2015 11:42:31 +0100
Subject: [PATCH 2/6] Add infomation about sapconf version BUG:1174321
---
sapconf | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sapconf b/sapconf
index c7492be..7a89392 100644
--- a/sapconf
+++ b/sapconf
@@ -37,7 +37,12 @@
# GLOBAL Variables
#
+SAPCONF_PACKAGE=`rpm -q sapconf`
+
export SCRIPTNAME=sapconf
+export SAPCONF_MAJOR_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f2 | cut -d'.' -f1)
+export SAPCONF_MINOR_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f2 | cut -d'.' -f2)
+export SAPCONF_BUILD_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f3 | cut -d'.' -f1)
export LOGDIR=/var/log/sap
export LOGFILE=${LOGDIR}/${SCRIPTNAME}-$(date +"%Y%m%d%H%M").log
@@ -922,7 +922,7 @@ if [ $1 ]; then
usage
fi
-out "###### ${SCRIPTNAME} by Red Hat ######"
+out "###### ${SCRIPTNAME}-${SAPCONF_MAJOR_VERSION}.${SAPCONF_MINOR_VERSION}-${SAPCONF_BUILD_VERSION} by Red Hat ######"
if [ $CHECK_ONLY == 0 ]; then
out "###### Preparing System for SAP Installation ######"
else
--
2.1.0

View File

@ -1,38 +0,0 @@
diff --git a/sapconf b/sapconf
index 471620e..f65451a 100644
--- a/sapconf
+++ b/sapconf
@@ -463,11 +463,13 @@ dn=$(dnsdomainname)
if [ -z "${dn}" ]; then
### This fails, if ip of $hs is unreachable or $hs unknown in nameservice
ip=$(ping -q -c 1 -t 1 $hs | grep PING | sed -e "s/^[^(]*[(]//" | sed -e "s/[)].*$//")
- [ ${ip} == "127.0.0.1" ] &&\
+ [ "${ip}" == "127.0.0.1" ] &&\
ip=$(ip addr show dev $( netstat -r | awk ' ( $1 == "default" ) { print $NF }')|awk '( $1 == "inet" ) { print $2 } ' | cut -d/ -f1)
- dn=$(/usr/bin/host $ip | cut -d' ' -f 5 | cut -d. -f 2-)
- dn=$(echo ${dn%.})
- hl=${hs}.${dn}
+ if [ -n "${ip}" ]; then
+ dn=$(/usr/bin/host $ip | cut -d' ' -f 5 | cut -d. -f 2-)
+ dn=$(echo ${dn%.})
+ hl=${hs}.${dn}
+ fi
fi
### No still no domainname is found DNS is not configured correctly
@@ -543,13 +545,13 @@ fi
num_ip=$( grep "^${ip}" /etc/hosts | wc -l)
### Now if localhost is ok and names are resolved correctly, assume /etc/host is ok. ####
-if [ $(hostname -f) == "${hl}" ] && [ $fix_localhost -eq 0 ] && [ $num_ip -eq 1 ]; then
+if [ "$(hostname -f)" == "${hl}" ] && [ $fix_localhost -eq 0 ] && [ $num_ip -eq 1 ]; then
out "/etc/hosts ... OK"
else
out "/etc/hosts checking ... not OK"
#### if ip is localhost, get ip from primary interface, identified by the default route
- [ ${ip} == "127.0.0.1" ] &&\
+ [ "${ip}" == "127.0.0.1" ] &&\
ip=$(ip addr show dev $( netstat -r | awk ' ( $1 == "default" ) { print $NF }')|awk '( $1 == "inet" ) { print $2 } ' | cut -d/ -f1)
if [ $CHECK_ONLY == 0 ]; then

View File

@ -1,14 +0,0 @@
diff -up sapconf-0.98/sapconf.than sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.than 2015-06-12 10:32:02.494997255 +0200
+++ sapconf-0.98/sapconf 2015-06-12 13:59:35.498510271 +0200
@@ -686,7 +686,9 @@ function check_chronyd() {
systemctl status chronyd.service > /dev/null 2>&1
rc=$?
-if [ $rc -eq 0 ]; then
+systemctl status ntpd.service > /dev/null 2>&1
+rc1=$?
+if [ $rc -eq 0 -o $rc1 -eq 0 ]; then
out "NTP service is running ... OK"
else
rec "NTP Service should be configured and started"

View File

@ -1,81 +0,0 @@
diff --git a/sapconf b/sapconf
index 5840b2c..97ea301 100644
--- a/sapconf
+++ b/sapconf
@@ -817,6 +817,68 @@ else
fi
}
+#####################################
+# function: check_glibc
+# parameters: none
+#
+# checks if the minimum version of glibc is installed
+function check_glibc() {
+for GLIBC_PACKAGE in $(rpm -q glibc)
+do
+ REQUIRED_MAJOR_VERSION=2
+ REQUIRED_MINOR_VERSION=17
+ REQUIRED_BUILD_VERSION=73
+ REQUIRED_BUILD_MINOR_VERSION=0
+ ARCHITECTURE=$(echo $GLIBC_PACKAGE | rev | cut -d'.' -f1 | rev)
+ MAJOR_VERSION=$(echo $GLIBC_PACKAGE | cut -d'-' -f2 | cut -d'.' -f1)
+ MINOR_VERSION=$(echo $GLIBC_PACKAGE | cut -d'-' -f2 | cut -d'.' -f2)
+ BUILD_VERSION=$(echo $GLIBC_PACKAGE | cut -d'-' -f3 | cut -d'.' -f1)
+ BUILD_MINOR_VERSION=$(echo $GLIBC_PACKAGE | rev | cut -d'.' -f2- | rev | cut -s -d'_' -f2 | cut -d'.' -f2)
+ UPDATE=0
+
+ if [ -z $BUILD_MINOR_VERSION ]; then
+ BUILD_MINOR_VERSION=0
+ fi
+
+ if [ $MAJOR_VERSION -lt $REQUIRED_MAJOR_VERSION ]; then
+ UPDATE=1
+ elif [ $MAJOR_VERSION -eq $REQUIRED_MAJOR_VERSION ]; then
+ if [ $MINOR_VERSION -lt $REQUIRED_MINOR_VERSION ]; then
+ UPDATE=1
+ elif [ $MINOR_VERSION -eq $REQUIRED_MINOR_VERSION ]; then
+ if [ $BUILD_VERSION -lt $REQUIRED_BUILD_VERSION ]; then
+ UPDATE=1
+ elif [ $BUILD_VERSION -eq $REQUIRED_BUILD_VERSION ]; then
+ if [ $BUILD_MINOR_VERSION -lt $REQUIRED_BUILD_MINOR_VERSION ]; then
+ UPDATE=1
+ else
+ UPDATE=0
+ fi
+ fi
+ fi
+ fi
+
+ if [ $UPDATE -eq 1 ]; then
+ if [ $CHECK_ONLY == 0 ]; then
+ out "Updating glibc ..."
+ yum -q -y update "glibc*.$ARCHITECTURE"
+ else
+ if [ $REQUIRED_BUILD_MINOR_VERSION -eq 0 ]; then
+ rec "Newer version of glibc is required. Minimum required glibc.$ARCHITECTURE version is glibc-$REQUIRED_MAJOR_VERSION.$REQUIRED_MINOR_VERSION-$REQUIRED_BUILD_VERSION.el7.$ARCHITECTURE."
+ rec "Installed version is glibc-$MAJOR_VERSION.$MINOR_VERSION-$BUILD_VERSION.el7.$ARCHITECTURE."
+ else
+ if [ $BUILD_MINOR_VERSION -eq 0 ]; then
+ rec "Newer version of glibc is required. Minimum required glibc.$ARCHITECTURE version is glibc-$REQUIRED_MAJOR_VERSION.$REQUIRED_MINOR_VERSION-$REQUIRED_BUILD_VERSION.el7_0.$REQUIRED_BUILD_MINOR_VERSION.$ARCHITECTURE. Installed version is glibc-$MAJOR_VERSION.$MINOR_VERSION-$BUILD_VERSION.el7.$ARCHITECTURE."
+ else
+ rec "Newer version of glibc is required. Minimum required glibc.$ARCHITECTURE version is glibc-$REQUIRED_MAJOR_VERSION.$REQUIRED_MINOR_VERSION-$REQUIRED_BUILD_VERSION.el7_0.$REQUIRED_BUILD_MINOR_VERSION.$ARCHITECTURE. Installed version is glibc-$MAJOR_VERSION.$MINOR_VERSION-$BUILD_VERSION.el7_0.$BUILD_MINOR_VERSION.$ARCHITECTURE."
+ fi
+ fi
+ fi
+ else
+ out "Required glibc.$ARCHITECTURE version is already installed"
+ fi
+done
+}
####################################################################################
#
@@ -894,6 +956,7 @@ for g in $SAPGROUPLIST; do
update_limits_conf @$g hard nofile 32800
update_limits_conf @$g soft nofile 32800
done
+check_glibc
out ""
if [ $CHECK_ONLY == 0 ]; then

View File

@ -1,27 +0,0 @@
diff -up sapconf-0.98/sapconf.resource-limit sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.resource-limit 2017-09-11 14:56:55.457791517 +0200
+++ sapconf-0.98/sapconf 2017-09-11 16:34:34.116857953 +0200
@@ -387,6 +387,7 @@ fi #[ $ec -eq 0 ]
function update_limits_conf() {
local date olds oldval news newval LIMITS
LIMITS=/etc/security/limits.d/99-sap-limits.conf
+ LIMITS_SAP_CONF=/etc/security/limits.d/99-sap.conf
LIMITS_CONF=/etc/security/limits.conf
date=`date -u +"%Y-%m-%d %H:%M:%S %Z"`
newval=($1 $2 $3 $4)
@@ -398,6 +399,15 @@ function update_limits_conf() {
if [ "${oldval[3]}" != "${newval[3]}" ]; then
sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS_CONF"
fi
+ elif [ -e "$LIMITS_SAP_CONF" ] ; then
+ olds=`tac "$LIMITS_SAP_CONF" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`
+ if [ $? -eq 0 ] ; then # entry there, update
+ oldval=($olds)
+ if [ "${oldval[3]}" != "${newval[3]}" ]; then
+ sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS_SAP_CONF"
+ fi
+ fi
+
else
if [ -e "$LIMITS" ]; then
olds=`tac "$LIMITS" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`

View File

@ -1,58 +0,0 @@
From 0fab85013ef072414d780daf5b08af761ccf6db2 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Tue, 7 Apr 2015 12:56:27 +0200
Subject: [PATCH 5/6] Check whether 99-sap-limits.conf file exists to prevent
an error while trying to update it Also check whether required configuration
is already configured in limits.conf file
BUG:1205229
---
sapconf | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
mode change 100644 => 100755 sapconf
diff --git a/sapconf b/sapconf
old mode 100644
new mode 100755
index 5bd8dcd..58096fe
--- a/sapconf
+++ b/sapconf
@@ -383,17 +383,31 @@ fi #[ $ec -eq 0 ]
function update_limits_conf() {
local date olds oldval news newval LIMITS
LIMITS=/etc/security/limits.d/99-sap-limits.conf
+ LIMITS_CONF=/etc/security/limits.conf
date=`date -u +"%Y-%m-%d %H:%M:%S %Z"`
newval=($1 $2 $3 $4)
news=${newval[*]}
- olds=`tac "$LIMITS" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`
+
+ olds=`tac "$LIMITS_CONF" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`
if [ $? -eq 0 ]; then # entry there, update
oldval=($olds);
if [ "${oldval[3]}" != "${newval[3]}" ]; then
- sed -i "s@$olds@# Changed by sapconf on $date\n#&\n$news@" "$LIMITS"
+ sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS_CONF"
+ fi
+ else
+ if [ -e "$LIMITS" ]; then
+ olds=`tac "$LIMITS" | grep -E "^[^#]*$1" | grep "$2" | grep -m1 "$3"`
+ if [ $? -eq 0 ]; then # entry there, update
+ oldval=($olds);
+ if [ "${oldval[3]}" != "${newval[3]}" ]; then
+ sed -i "s/$olds/# Changed by sapconf on $date\n#\ &\n$news/" "$LIMITS"
+ fi
+ else # no entry, make one
+ echo -e "# Added by sapconf on $date\n$news" >> "$LIMITS"
+ fi
+ else
+ echo -e "# Added by sapconf on $date\n$news" >> "$LIMITS"
fi
- else # no entry, make one
- echo -e "# Added by sapconf on $date\n$news" >> "$LIMITS"
fi
}
--
2.1.0

View File

@ -1,26 +0,0 @@
From a010ffd8dce8c801b5721df7f6f9db166b86626d Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Tue, 3 Feb 2015 11:17:25 +0100
Subject: [PATCH 1/6] Do not wait for input from keyboard and read from file
instead BUG:1188233, 1173861
---
sapconf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sapconf b/sapconf
index 154c27a..c7492be 100644
--- a/sapconf
+++ b/sapconf
@@ -622,7 +622,7 @@ else
if egrep -q "^SELINUX=['\"]?disabled" $SELINUX_CONFIG; then
rec "SElinux is configured to be disabled on boot. It's recommended to be set to permissive, however your system may then require to be relabeled. Please check $SAP_NOTE_RHEL7 for details."
else
- if egrep -q "^SELINUX=['\"]?permissive"; then
+ if egrep -q "^SELINUX=['\"]?permissive" $SELINUX_CONFIG; then
out "SELinux is configured to be permissive... OK"
else
rec "Unable to determine SELinux configuration ($SELINUX_CONFIG). Please configure your system to be booted with SELinux enabled in permissive mode. Please check $SAP_NOTE_RHEL7 for details."
--
2.1.0

View File

@ -1,12 +0,0 @@
diff -up sapconf-0.98/sapconf.identify-e4s-sap-channel sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.identify-e4s-sap-channel 2017-11-06 14:07:34.355278090 +0100
+++ sapconf-0.98/sapconf 2017-11-06 14:17:57.512727114 +0100
@@ -713,7 +713,7 @@ fi
# Checks if system is subscribed to RHEL for SAP Channel
function check_rhn() {
-if yum repolist | egrep -q "rhel-sap-for-rhel-7-server-eus-rpms|rhel-$(uname -m)-server-sap|rhel-sap-for-rhel-$(awk '{print $7}' /etc/redhat-release | cut -c -1)-server-rpms"; then
+if yum repolist | egrep -q "rhel-$(uname -m)-server-sap|rhel-sap-for-rhel-$(awk '{print $7}' /etc/redhat-release | cut -c -1)-server(-e4s|-eus)?-rpms"; then
out "RHEL system subscribed to RHEL for SAP channel ... OK"
else
out "RHEL system not subscribed to RHEL for SAP channel ... WARNING"

View File

@ -1,12 +0,0 @@
diff -up sapconf-0.98/sapconf.identify-eus-sap-channel sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.identify-eus-sap-channel 2017-09-11 14:25:35.090406132 +0200
+++ sapconf-0.98/sapconf 2017-09-11 14:27:06.529971856 +0200
@@ -703,7 +703,7 @@ fi
# Checks if system is subscribed to RHEL for SAP Channel
function check_rhn() {
-if yum repolist | egrep -q "rhel-$(uname -m)-server-sap|rhel-sap-for-rhel-$(awk '{print $7}' /etc/redhat-release | cut -c -1)-server-rpms"; then
+if yum repolist | egrep -q "rhel-sap-for-rhel-7-server-eus-rpms|rhel-$(uname -m)-server-sap|rhel-sap-for-rhel-$(awk '{print $7}' /etc/redhat-release | cut -c -1)-server-rpms"; then
out "RHEL system subscribed to RHEL for SAP channel ... OK"
else
out "RHEL system not subscribed to RHEL for SAP channel ... WARNING"

View File

@ -1,12 +0,0 @@
diff --git a/sapconf b/sapconf
index 5840b2c..154c27a 100644
--- a/sapconf
+++ b/sapconf
@@ -78,7 +78,7 @@ SEMMNS_MIN=256000
SEMOPM_MIN=100
SEMMNI_MIN=8192
-MAX_MAP_COUNT_MIN=300000
+MAX_MAP_COUNT_MIN=2000000
SAPGROUPLIST="sapsys sdba dba"

View File

@ -1,25 +0,0 @@
From 67a81234bdb202454f2176de46198daa070031e5 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Thu, 2 Apr 2015 16:35:05 +0200
Subject: [PATCH 4/6] Remove unnecessary installed package groups BUG:1193983
---
sapconf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sapconf b/sapconf
index 9ffc8fa..5bd8dcd 100644
--- a/sapconf
+++ b/sapconf
@@ -95,7 +95,7 @@ EXEC_SHIELD_REQ=0
# Define required RPMs
# RPMS contains rpms recommended by SAP Note
-RPMS="@compat-libraries @debugging @directory-client @hardware-monitoring @large-systems @network-file-system-client @perl-runtime @storage-client-multipath @x11 uuidd tuned-profiles-sap"
+RPMS="@compat-libraries @large-systems @network-file-system-client @performance uuidd tuned-profiles-sap"
# VIRTRPMS is a variable used by function virtrpms and check_rpms. In virtrpms the rpms that are required by SAP on virtual guests will be set in VIRTRPMS, and installed by check_rpms. Currently vm-dump-metrics is installed on KVM/RHEV based guests. XEN and VMware are not implemented.
VIRTRPMS=""
--
2.1.0

View File

@ -1,12 +0,0 @@
diff -up sapconf-0.98/sapconf.than sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.than 2015-09-22 11:07:41.911392600 +0200
+++ sapconf-0.98/sapconf 2015-09-22 11:08:02.777264895 +0200
@@ -728,7 +728,7 @@ if [ $CHECK_ONLY == 0 ]; then
if [ "$(echo $gp | cut -c 1)" == "@" ]; then
# rpm groups
gi=0
- for r in $(repoquery --plugin -g --grouppkgs=default -l $(echo $gp| cut -c2-)); do
+ for r in $(repoquery --plugin -g --grouppkgs=mandatory -l $(echo $gp| cut -c2-)); do
rpm -q $r > /dev/null 2>&1
rc=$?
gi=$(( $rc + $gi ))

View File

@ -1,33 +0,0 @@
diff -up sapconf-0.98/sapconf.shmall-shmmax sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.shmall-shmmax 2016-11-11 17:18:30.613505902 +0100
+++ sapconf-0.98/sapconf 2016-11-11 17:19:28.216292840 +0100
@@ -10,6 +10,7 @@
# Jaroslav Škarvada <jskarvad@redhat.com>
# Nils Philippsen <nils@redhat.com>
# Jan Grulich <jgrulich@redhat.com>
+# Than Ngo <than@redhat.com>
############################################################################
#
@@ -310,10 +311,10 @@ for i in $VARS; do
#[ $VERBOSE -eq 1 ] && echo "OLD: $i: ${!i} ($req=${!req}) ($min=${!min})"
[ ${!req} -lt ${!min} ] && eval $req=${!min} # new = max(calculated, minimum)
# 'unlimited' is realized as -1, take care of this
- if [ $((${!i})) -lt 0 ]; then
+ if (( $(bc <<< "${!i} < 0") )); then
eval $req=$((${!i}))
else
- [ ${!i} -gt ${!req} ] && eval $req=${!i} # new = max(current, recommended)
+ (( $(bc <<< "${!i} > ${!req}") )) && eval $req=${!i} # new = max(current, recommended)
fi
#[ $VERBOSE -eq 1 ] && echo "NEW: $i: ${!i} ($req=${!req}) ($min=${!min})"
done
@@ -323,7 +324,7 @@ out "Checking Kernel Parameters ... In P
ec=0
for v in $VARS; do
eval "s=\$${v} ; r=\$${v}_REQ"
- if [ $s -ge $r ]; then
+ if (( $(bc <<< "$s == $r") )) ; then
out "$v : $s ... OK"
else
out "$v : set: $s, required: $r ... NEEDS TO BE CHANGED"

View File

@ -1,14 +0,0 @@
diff --git a/sapconf b/sapconf
index 6cd6173..471620e 100644
--- a/sapconf
+++ b/sapconf
@@ -636,7 +636,7 @@ fi
if systemctl status firewalld.service > /dev/null 2>&1 ; then
if [ $CHECK_ONLY == 0 ]; then
# disable firewall or open required ports
- systemctl disable firewalld.service
+ systemctl disable firewalld.service > /dev/null 2>&1
systemctl stop firewalld.service > /dev/null 2>&1
out "Firewall has been disabled for SAP"
else

View File

@ -1,141 +0,0 @@
diff --git a/sapconf b/sapconf
index 369b6be..6cd6173 100644
--- a/sapconf
+++ b/sapconf
@@ -180,7 +180,7 @@ function rec_out() {
out ""
out "###### RECOMMENDATIONS ######"
out "## Below are recommended settings that can not ##"
-out "## Be carried out by the ${SCRIPTNAME} script ##"
+out "## Be carried out by the ${SCRIPTNAME} script ##"
out "## Please check and set them manually ##"
out "## ---------------------------------------------- ##"
for (( i=1; i<=$rec_count; i++))
@@ -276,7 +276,13 @@ SHMMAX_REQ=$(( $VIRT_MEMORY_TOTAL * 1024 * 1024 * 1024 ))
# The two kernel parameters required by Sybase ASE
RANDOMIZE_VA_SPACE=`/sbin/sysctl -n kernel.randomize_va_space`
-EXEC_SHIELD=`/sbin/sysctl -n kernel.exec-shield`
+EXEC_SHIELD=`/sbin/sysctl -en kernel.exec-shield`
+
+# Check if exec-shield is not set as it seems to be not used on 64bit systems, otherwise set it
+# to 0 to indicate that is already disabled
+if [ -z "$EXEC_SHIELD" ]; then
+ EXEC_SHIELD=0
+fi
ARCH=`uname -m`
case $ARCH in
@@ -498,7 +504,7 @@ else
fi
## modify /etc/hosts
-## at this point in time /etc/sysconfig network is ok.
+## at this point in time /etc/sysconfig/network is ok.
## so still need to check, if hosts is correct.
# Check what happens if $hs=localhost or if a different branch needs to be added, which
# finds the ip adress of the first network card
@@ -627,13 +633,12 @@ if [ $(getenforce | awk '{ print $1 } ') = enforcing ]; then
fi
# Firewall needs to be off
-if service iptables status > /dev/null 2>&1 ; then
+if systemctl status firewalld.service > /dev/null 2>&1 ; then
if [ $CHECK_ONLY == 0 ]; then
# disable firewall or open required ports
- service iptables save > /dev/null 2>&1
- chkconfig iptables off
- service iptables stop > /dev/null 2>&1
- out "Firewall has been disabled for SAP. iptables settings are saved in file /etc/sysconfig/iptables"
+ systemctl disable firewalld.service
+ systemctl stop firewalld.service > /dev/null 2>&1
+ out "Firewall has been disabled for SAP"
else
rec "Firewall is enabled. If you leave the firewall on please open up the ports for SAP products. Firewall will be disabled by ${SCRIPTNAME} in execution mode"
#out "Firewall state ... OK"
@@ -650,7 +655,9 @@ fi
function check_chronyd() {
-if service chronyd status 1>/dev/null 2>&1 ; then
+systemctl status chronyd.service > /dev/null 2>&1
+rc=$?
+if [ $rc -eq 0 ]; then
out "NTP service is running ... OK"
else
rec "NTP Service should be configured and started"
@@ -731,7 +738,7 @@ fi
function check_links() {
# set symbolic links for LDAP
-if [ -e /usr/lib64/libldap.so.199 -a -e /usr/lib64/liblber.so.199 ]; then
+if [ -L /usr/lib64/libldap.so.199 -a -L /usr/lib64/liblber.so.199 ]; then
out "SAP LDAP Links ... OK"
else
#out "SAP LDAP Links ... not OK"
@@ -748,7 +755,7 @@ else
fi
# old version backward compatibility
-if [ -e /usr/lib/libstdc++-libc6.1-1.so.3 ]; then
+if [ -L /usr/lib/libstdc++-libc6.1-1.so.3 ]; then
out "SAP old version compat links ... OK"
else
#out "SAP old version compat Links ... not OK"
@@ -771,20 +778,22 @@ fi
function check_uuidd() {
if [ $CHECK_ONLY == 0 ]; then
- if chkconfig uuidd; then
+ systemctl is-enabled uuidd.service > /dev/null 2>&1
+ rc=$?
+ if [ $rc -eq 0 ]; then
out "Service uuidd autostart ... OK"
else
# uuidd permissions
- chkconfig uuidd on
+ systemctl enable uuidd.service
out "Service uuidd set to autostart ... OK"
fi
- service uuidd status > /dev/null 2>&1
+ systemctl status uuidd.service > /dev/null 2>&1
rc=$?
if [ $rc -eq 0 ]; then
out "Service uuidd already running"
else
out "Service uuidd not running ... Starting"
- service uuidd start > /dev/null 2>&1
+ systemctl start uuidd.service > /dev/null 2>&1
fi
else
rpm -q uuidd > /dev/null 2>&1
@@ -792,13 +801,15 @@ else
if [ $rc -eq 1 ]; then
rec "Please make sure that package uuidd is installed, and service uuidd is started and set to autostart: yum install -y -q uuidd; service uuidd start; chkconfig uuidd on"
else
- if !(chkconfig uuidd); then
- rec "Please make sure that service uuidd is set to autostart: chkconfig uuidd on"
+ systemctl is-enabled uuidd.service > /dev/null 2>&1
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ rec "Please make sure that service uuidd is set to autostart: systemctl enable uuidd.service"
fi
- service uuidd status > /dev/null 2>&1
+ systemctl status uuidd.service > /dev/null 2>&1
rc=$?
if [ $rc -ne 0 ]; then
- rec "Please make sure that service uuidd is started: service uuidd start"
+ rec "Please make sure that service uuidd is started: systemctl start uuidd.service"
fi
fi
fi
@@ -842,7 +853,7 @@ if [ $1 ]; then
usage
fi
-out "###### ${SCRIPTNAME} by Red Hat ######"
+out "###### ${SCRIPTNAME} by Red Hat ######"
if [ $CHECK_ONLY == 0 ]; then
out "###### Preparing System for SAP Installation ######"
else

View File

@ -1,17 +0,0 @@
diff -up sapconf-0.98/sapconf.dmidecode-deps sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.dmidecode-deps 2016-09-20 18:03:43.790482636 +0200
+++ sapconf-0.98/sapconf 2016-09-20 18:08:07.907549245 +0200
@@ -721,7 +721,12 @@ fi
function check_rpms() {
#virtrpms checks if the system is a virtualization guest that requires additional rpms
-virtrpms
+
+# bz#1377766, dmidecode is not supported on s390x/ppc64, skip it on these
+# platforms temporary before we have generic solution.
+if [ -x /usr/sbin/dmidecode -o -x /usr/bin/dmidecode ] ; then
+ virtrpms
+fi
if [ $CHECK_ONLY == 0 ]; then
for gp in $RPMS $EXTRA_RPMS $VIRTRPMS; do

View File

@ -1,15 +0,0 @@
diff -up sapconf-0.98/sapconf.incorrect-check-hostname-13-chars sapconf-0.98/sapconf
--- sapconf-0.98/sapconf.incorrect-check-hostname-13-chars 2017-03-16 14:14:01.518612513 +0100
+++ sapconf-0.98/sapconf 2017-03-16 14:14:40.157153477 +0100
@@ -621,9 +621,9 @@ rm -f "$hosts_temp"
###### Just checking for length of hostname due to http://scn.sap.com/message/210257 / SAP Note 611361 #####
-[ $(hostname -s | wc -c) -gt 13 ] &&\
+[ $(hostname -s | wc -c) -gt 14 ] &&\
rec "your hostname is greater than 13 characters. Please see SAP Note 611361 for details"
-#[ $(hostname -s | wc -c) -gt 8 ] &&\
+#[ $(hostname -s | wc -c) -gt 9 ] &&\
# rec "your hostname is greater than 8 characters, which is not support on SAP rel. up to 4.5. Please see SAP Note 611361 for details"
}

View File

@ -1,36 +1,18 @@
Name: sapconf Name: sapconf
Version: 0.98 Version: 0.99
Release: 15%{?dist} Release: 4%{?dist}
Summary: Prepares a RHEL system for running SAP software Summary: Prepares a RHEL system for running SAP software
Group: System Environment/Base Group: System Environment/Base
License: GPLv2+ License: GPLv2+
URL: http://redhat.com/sap URL: http://redhat.com/sap
Source0: %{name}-%{version}.tar.bz2 Source0: %{name}-%{version}.tar.xz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Patch0: sapconf-0.99-#1670494-dnf-repoquery-issue.patch
Patch1: sapconf-0.99-#1701314-function-check_rhn-does-not-cath-major-release-number.patch
Patch2: sapconf-0.99-#11701246-function-check_links.patch
Patch3: sapconf-0.99-usage-exit-state.patch
BuildArch: noarch BuildArch: noarch
Patch0: sapconf-add-info-about-kvm-to-manpage.patch
Patch1: sapconf-use-systemct-instead-service-and-chkconfig.patch
Patch2: sapconf-supress-spamming-output-when-disabling-firewalld.patch
Patch3: sapconf-add-missing-quotes-to-prevent-error-message.patch
Patch4: sapconf-activate-sap-netwear-tuned-profile.patch
Patch5: sapconf-check-required-glibc-version.patch
Patch6: sapconf-incorrect-vm-max-map-count.patch
Patch7: sapconf-do-not-wait-for-input-from-keyboard-and-read-from-file.patch
Patch8: sapconf-add-infomation-about-sapconf-version.patch
Patch9: sapconf-remove-unnecessary-installed-package-groups.patch
Patch10: sapconf-check-whether-99-sap-limits.conf-file-exists-to-prevent-error.patch
Patch11: sapconf-add-force-mode.patch
Patch12: sapconf-check-ntp-bz#1228550.patch
Patch13: sapconf-repoquery-correct-parameter.patch
Patch14: sapconf.dmidecode-deps.patch
Patch15: sapconf-shmall-shmmax.patch
Patch16: sapconf.incorrect-check-hostname-13-chars
Patch17: sapconf-identify-eus-sap-channel
Patch18: sapconf-check-resource-limit
Patch19: sapconf-identify-e4s-sap-channel.patch
Requires: /bin/bash Requires: /bin/bash
# Require tuned versions that include an SAP profile # Require tuned versions that include an SAP profile
%if ! 0%{?rhel} || 0%{?rhel} >= 7 %if ! 0%{?rhel} || 0%{?rhel} >= 7
@ -48,36 +30,22 @@ Requires: dmidecode
Requires: yum-utils Requires: yum-utils
Requires: bc Requires: bc
Requires: bind-utils Requires: bind-utils
# sapconf has been obsoleted. We want to get rid of it from rhel8
# in favor of rhel-system-roles-sap package. Marking it deprecated
Provides: deprecated()
%description %description
This package contains a script that checks and/or modifies a RHEL base This package contains a script that checks and/or modifies a RHEL base
install according to SAP requirements, e.g. kernel parameters, packages etc., install according to SAP requirements, e.g. kernel parameters, packages etc.,
as documented in SAP Note 2002167 " Red Hat Enterprise Linux 7.x: Installation as documented in SAP Note 2002167 " Red Hat Enterprise Linux 8.x: Installation
and Upgrade". and Upgrade".
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .#1670494-dnf-repoquery-issue
%patch0 -p1 -b .add-info-about-kvm-to-manpage %patch1 -p1 -b .#1701314-function-check_rhn-does-not-cath-major-release-number
%patch1 -p1 -b .use-systemct-instead-service-and-chkconfig %patch2 -p1 -b .#11701246-function-check_links
%patch2 -p1 -b .supress-spamming-output-when-disabling-firewalld %patch3 -p1 -b .usage-exit-state
%patch3 -p1 -b .add-missing-quotes-to-prevent-error-message
%patch4 -p1 -b .activate-sap-netwear-tuned-profile
%patch5 -p1 -b .check-required-glibc-version
%patch6 -p1 -b .incorrect-vm-max-map-count
%patch7 -p1 -b .do-not-wait-for-input-from-keyboard-and-read-from-file
%patch8 -p1 -b .add-infomation-about-sapconf-version
%patch9 -p1 -b .remove-unnecessary-installed-package-groups
%patch10 -p1 -b .check-whether-99-sap-limits.conf-file-exists-to-prevent-error
%patch11 -p1 -b .add-force-mode
%patch12 -p1 -b .check-ntp-bz#1228550.patch
%patch13 -p1 -b .repoquery-correct-parameter
%patch14 -p1 -b .dmidecode-deps
%patch15 -p1 -b .shmall-shmmax
%patch16 -p1 -b .incorrect-check-hostname-13-chars
%patch17 -p1 -b .sapconf-identify-eus-sap-channel
%patch18 -p1 -b .sapconf-check-resource-limit
%patch19 -p1 -b .identify-e4s-sap-channel
%build %build
@ -98,6 +66,21 @@ rm -rf %buildroot
%doc COPYING README %doc COPYING README
%changelog %changelog
* Thu Aug 06 2020 Than Ngo <than@redhat.com> - 0.99-4
- Resolves: #1866422, mark sapconf deprecated
* Thu May 23 2019 Than Ngo <than@redhat.com> - 0.99-3
- Related: #1681546, fix return value in function usage
* Thu May 23 2019 Than Ngo <than@redhat.com> - 0.99-2
- Resolves: #1681546, add gating on dist-git tests
* Tue May 21 2019 Than Ngo <than@redhat.com> - 0.99-1
- Resolves: #1701246, disable check_links()
- Resolves: #1670494, workaround for dnf repoquery issues
- Resolves: #1701314, function check_rhn() does not catch major release number
- merged patches and released 0.99
* Mon Nov 06 2017 Than Ngo <than@redhat.com> - 0.98-15 * Mon Nov 06 2017 Than Ngo <than@redhat.com> - 0.98-15
- Resolves: bz#1509921 - sapconf does not identify E4S SAP channel as a SAP channel - Resolves: bz#1509921 - sapconf does not identify E4S SAP channel as a SAP channel