commit 5164e3229e333ce2401fb42d20718a04620c813b Author: CentOS Sources Date: Tue May 7 04:13:43 2019 -0400 import sapconf-0.98-15.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11bbb4e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sapconf-0.98.tar.bz2 diff --git a/.sapconf.metadata b/.sapconf.metadata new file mode 100644 index 0000000..f9d4937 --- /dev/null +++ b/.sapconf.metadata @@ -0,0 +1 @@ +082fc8c7a555c4e12f7b222011a3f9042b97408c SOURCES/sapconf-0.98.tar.bz2 diff --git a/SOURCES/sapconf-activate-sap-netwear-tuned-profile.patch b/SOURCES/sapconf-activate-sap-netwear-tuned-profile.patch new file mode 100644 index 0000000..df46941 --- /dev/null +++ b/SOURCES/sapconf-activate-sap-netwear-tuned-profile.patch @@ -0,0 +1,38 @@ +--- 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 : 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 ] + } diff --git a/SOURCES/sapconf-add-force-mode.patch b/SOURCES/sapconf-add-force-mode.patch new file mode 100644 index 0000000..485e6a2 --- /dev/null +++ b/SOURCES/sapconf-add-force-mode.patch @@ -0,0 +1,144 @@ +From 4697e670434d01464723d3f3da6608ea6d650cf2 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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 : uses the given file instead of /etc/sysconfig/sap (FUTURE USE) +-# -n : just check and don't modify +-# -q : quiet, no output +-# -d : used to set special parameters for Sybase and Oracle ++# -d : 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 ] [-n] [-q] ++Usage: $0 [-d ] [-f] [-n] [-q] + + -d : 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 ] [-n] [-q] ++sapconf [-d ] [-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 : 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 : 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 + diff --git a/SOURCES/sapconf-add-info-about-kvm-to-manpage.patch b/SOURCES/sapconf-add-info-about-kvm-to-manpage.patch new file mode 100644 index 0000000..5a60865 --- /dev/null +++ b/SOURCES/sapconf-add-info-about-kvm-to-manpage.patch @@ -0,0 +1,14 @@ +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 diff --git a/SOURCES/sapconf-add-infomation-about-sapconf-version.patch b/SOURCES/sapconf-add-infomation-about-sapconf-version.patch new file mode 100644 index 0000000..75b0b3c --- /dev/null +++ b/SOURCES/sapconf-add-infomation-about-sapconf-version.patch @@ -0,0 +1,38 @@ +From 7726f121d2693025ae46f3047d7734c0d03942ad Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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 + diff --git a/SOURCES/sapconf-add-missing-quotes-to-prevent-error-message.patch b/SOURCES/sapconf-add-missing-quotes-to-prevent-error-message.patch new file mode 100644 index 0000000..d70aa3c --- /dev/null +++ b/SOURCES/sapconf-add-missing-quotes-to-prevent-error-message.patch @@ -0,0 +1,38 @@ +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 diff --git a/SOURCES/sapconf-check-ntp-bz#1228550.patch b/SOURCES/sapconf-check-ntp-bz#1228550.patch new file mode 100644 index 0000000..7200d19 --- /dev/null +++ b/SOURCES/sapconf-check-ntp-bz#1228550.patch @@ -0,0 +1,14 @@ +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" diff --git a/SOURCES/sapconf-check-required-glibc-version.patch b/SOURCES/sapconf-check-required-glibc-version.patch new file mode 100644 index 0000000..c2ba8bc --- /dev/null +++ b/SOURCES/sapconf-check-required-glibc-version.patch @@ -0,0 +1,81 @@ +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 diff --git a/SOURCES/sapconf-check-resource-limit b/SOURCES/sapconf-check-resource-limit new file mode 100644 index 0000000..3dfe1c9 --- /dev/null +++ b/SOURCES/sapconf-check-resource-limit @@ -0,0 +1,27 @@ +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"` diff --git a/SOURCES/sapconf-check-whether-99-sap-limits.conf-file-exists-to-prevent-error.patch b/SOURCES/sapconf-check-whether-99-sap-limits.conf-file-exists-to-prevent-error.patch new file mode 100644 index 0000000..95428b2 --- /dev/null +++ b/SOURCES/sapconf-check-whether-99-sap-limits.conf-file-exists-to-prevent-error.patch @@ -0,0 +1,58 @@ +From 0fab85013ef072414d780daf5b08af761ccf6db2 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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 + diff --git a/SOURCES/sapconf-do-not-wait-for-input-from-keyboard-and-read-from-file.patch b/SOURCES/sapconf-do-not-wait-for-input-from-keyboard-and-read-from-file.patch new file mode 100644 index 0000000..2a6b779 --- /dev/null +++ b/SOURCES/sapconf-do-not-wait-for-input-from-keyboard-and-read-from-file.patch @@ -0,0 +1,26 @@ +From a010ffd8dce8c801b5721df7f6f9db166b86626d Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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 + diff --git a/SOURCES/sapconf-identify-e4s-sap-channel.patch b/SOURCES/sapconf-identify-e4s-sap-channel.patch new file mode 100644 index 0000000..a21ef77 --- /dev/null +++ b/SOURCES/sapconf-identify-e4s-sap-channel.patch @@ -0,0 +1,12 @@ +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" diff --git a/SOURCES/sapconf-identify-eus-sap-channel b/SOURCES/sapconf-identify-eus-sap-channel new file mode 100644 index 0000000..72d6630 --- /dev/null +++ b/SOURCES/sapconf-identify-eus-sap-channel @@ -0,0 +1,12 @@ +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" diff --git a/SOURCES/sapconf-incorrect-vm-max-map-count.patch b/SOURCES/sapconf-incorrect-vm-max-map-count.patch new file mode 100644 index 0000000..31cd12c --- /dev/null +++ b/SOURCES/sapconf-incorrect-vm-max-map-count.patch @@ -0,0 +1,12 @@ +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" diff --git a/SOURCES/sapconf-remove-unnecessary-installed-package-groups.patch b/SOURCES/sapconf-remove-unnecessary-installed-package-groups.patch new file mode 100644 index 0000000..28309d8 --- /dev/null +++ b/SOURCES/sapconf-remove-unnecessary-installed-package-groups.patch @@ -0,0 +1,25 @@ +From 67a81234bdb202454f2176de46198daa070031e5 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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 + diff --git a/SOURCES/sapconf-repoquery-correct-parameter.patch b/SOURCES/sapconf-repoquery-correct-parameter.patch new file mode 100644 index 0000000..7e1513a --- /dev/null +++ b/SOURCES/sapconf-repoquery-correct-parameter.patch @@ -0,0 +1,12 @@ +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 )) diff --git a/SOURCES/sapconf-shmall-shmmax.patch b/SOURCES/sapconf-shmall-shmmax.patch new file mode 100644 index 0000000..5db64a9 --- /dev/null +++ b/SOURCES/sapconf-shmall-shmmax.patch @@ -0,0 +1,33 @@ +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 + # Nils Philippsen + # Jan Grulich ++# Than Ngo + + ############################################################################ + # +@@ -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" diff --git a/SOURCES/sapconf-supress-spamming-output-when-disabling-firewalld.patch b/SOURCES/sapconf-supress-spamming-output-when-disabling-firewalld.patch new file mode 100644 index 0000000..4c73a0e --- /dev/null +++ b/SOURCES/sapconf-supress-spamming-output-when-disabling-firewalld.patch @@ -0,0 +1,14 @@ +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 + diff --git a/SOURCES/sapconf-use-systemct-instead-service-and-chkconfig.patch b/SOURCES/sapconf-use-systemct-instead-service-and-chkconfig.patch new file mode 100644 index 0000000..ff4c5b6 --- /dev/null +++ b/SOURCES/sapconf-use-systemct-instead-service-and-chkconfig.patch @@ -0,0 +1,141 @@ +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 + diff --git a/SOURCES/sapconf.dmidecode-deps.patch b/SOURCES/sapconf.dmidecode-deps.patch new file mode 100644 index 0000000..a236b5d --- /dev/null +++ b/SOURCES/sapconf.dmidecode-deps.patch @@ -0,0 +1,17 @@ +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 diff --git a/SOURCES/sapconf.incorrect-check-hostname-13-chars b/SOURCES/sapconf.incorrect-check-hostname-13-chars new file mode 100644 index 0000000..ff5259d --- /dev/null +++ b/SOURCES/sapconf.incorrect-check-hostname-13-chars @@ -0,0 +1,15 @@ +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" + + } diff --git a/SPECS/sapconf.spec b/SPECS/sapconf.spec new file mode 100644 index 0000000..fb5173f --- /dev/null +++ b/SPECS/sapconf.spec @@ -0,0 +1,273 @@ +Name: sapconf +Version: 0.98 +Release: 15%{?dist} +Summary: Prepares a RHEL system for running SAP software + +Group: System Environment/Base +License: GPLv2+ +URL: http://redhat.com/sap +Source0: %{name}-%{version}.tar.bz2 +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +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 +# Require tuned versions that include an SAP profile +%if ! 0%{?rhel} || 0%{?rhel} >= 7 +# RHEL >= 7 +Requires: tuned > 2.2.2 +%else +# RHEL 6 +Requires: tuned >= 0.2.19-13 +%endif +Requires: tuned-profiles-sap +Requires: uuidd +%ifarch %{ix86} x86_64 ia64 aarch64 +Requires: dmidecode +%endif +Requires: yum-utils +Requires: bc +Requires: bind-utils + +%description +This package contains a script that checks and/or modifies a RHEL base +install according to SAP requirements, e.g. kernel parameters, packages etc., +as documented in SAP Note 2002167 " Red Hat Enterprise Linux 7.x: Installation +and Upgrade". + +%prep +%setup -q + +%patch0 -p1 -b .add-info-about-kvm-to-manpage +%patch1 -p1 -b .use-systemct-instead-service-and-chkconfig +%patch2 -p1 -b .supress-spamming-output-when-disabling-firewalld +%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 + + +%install +rm -rf %buildroot +make DESTDIR="%buildroot" install + +%clean +rm -rf %buildroot + + +%files +%defattr(-,root,root,-) +%{_bindir}/sapconf +%{_mandir}/man8/sapconf.8.gz + +%doc COPYING README + +%changelog +* Mon Nov 06 2017 Than Ngo - 0.98-15 +- Resolves: bz#1509921 - sapconf does not identify E4S SAP channel as a SAP channel + +* Mon Nov 06 2017 Than Ngo - 0.98-14 +- Resolves: bz#1509913, add missing dependency for bind-utils + +* Wed Sep 27 2017 Than Ngo - 0.98-13 +- add requirement on bc for sapconf + Resolves: bz#1496184 + +* Mon Sep 11 2017 Than Ngo - 0.98-12 +- sapconf does not identify EUS SAP channel a s a SAP channel + Resolves: bz#1470563 + +- sapconf does not check if limits are set before adding it's own entires + Resolves: bz#1474024 + +* Thu Mar 16 2017 Than Ngo - 0.98-11 +- sapconf fails on hostnames with exactly 13 characters + Resolves: bz#1432572 + +* Fri Nov 11 2016 Than Ngo - 0.98-10 +- sapconf cannot go with default values kernel.shmall and kernel.shmmax + Resolves: bz#1391881 + +* Tue Sep 20 2016 Than Ngo - 0.98-9 +- fix depends on dmidecode on s390x/ppc64 + Resolves: bz#1377766 + +* Fri Apr 08 2016 Than Ngo - 0.98-8 +- consider ntp configured via ntp package + Resolves: bz#1228550 +- add correct parameter for repoquery + Resolves: bz#1235608 + +* Mon May 18 2015 Jan Grulich - 0.98-7 +- Do not wait for input from keyboard and read from file instead + Resolves: bz#1188233 +- Add information about sapconf version + Resolves: bz#1205269 +- Remove unnecessary installed package groups + Resolves: bz#1193983 +- Check whether 99-sap-limits.conf file exists to prevent an error + Resolves: bz#1205229 +- Add force mode + Resolves: bz#1205691 +- Add yum-utils as dependency + Resolves: bz#1220471 + +* Mon Dec 08 2014 Jan Grulich - 0.98-6 +- Check minimum required glibc version due to bz#1156331 + Resolves: bz#1170630 +- Set correct vm.max_map_count value + Resolves: bz#1168541 + +* Thu Nov 06 2014 Jan Grulich - 0.98-5 +- add missing tuned-profiles-sap dependency + resolves: bz##1158409 + +* Thu Oct 30 2014 Jan Grulich - 0.98-4 +- activate SAP NetWeaver tuned profile (#1158409) + split patches + +* Fri Oct 03 2014 Jan Grulich - 0.98-3 +- prevent from an error from /usr/bin/host when ip address is empty (#1123920) + +* Mon Sep 29 2014 Jan Grulich - 0.98-2 +- pickup fixes from git +- mention KVM in manpage (#1077498) +- prevent from an error message when invalid hostname is set (#1123920) + +* Thu Jul 17 2014 Jan Grulich - 0.98-1 +- add Man-Page (#1071933) +- correctly detect VMware virtual guest (#1071939) +- do not write to /etc/security/limits.conf directly (#1071942) +- correctly edit /etc/hosts (#1071928, #1083932) +- use a better way how to restore permissions for /etc/hosts (bz#1083932) +- updated SAP Note (#1077502) + +* Mon Mar 03 2014 Jan Grulich - 0.97-2 +- check running chronyd instead of ntp +- replace RHEL6 with RHEL7 + +* Fri Aug 09 2013 Nils Philippsen - 0.97-1 +- use correct mktemp path + +* Fri Aug 09 2013 Nils Philippsen - 0.96-1 +- don't use gethostip + +* Thu Aug 08 2013 Nils Philippsen - 0.95-1 +- ignore whitespace and empty lines when checking /etc/hosts +- use mktemp to create temporary host file +- add release numbers to changelog entries + +* Tue Aug 06 2013 Nils Philippsen - 0.94-1 +- don't use unquoted macros in changelog +- package license text + +* Tue Jul 30 2013 Nils Philippsen - 0.93-1 +- remove obsolete tuned patch +- fix changelog dates +- require specific tuned version, prep for upcoming RHEL versions +- clean up script header +- don't mess around with SELinux settings, just report +- use bzipped tarball + +* Mon Jul 22 2013 Frank Danapfel - 0.93 +- replaced vhostmd with vm-dump-metrics for KVM guest installs +- re-added function to set user/process limits +- changed check_ntp to only check if ntpd is running + +* Tue Jul 09 2013 Frank Danapfel - 0.93 +- removed /etc/init.d/sapconf service, since this is now done via tuned +- cleaned up requirements section in spec file +- added changelog to spec file + +* Mon Nov 19 2012 Sherry Yu - 0.92 +- Changed the name to sapconf +- Move kernel parameters to /etc/sysconfig/sap, other than /etc/sysctl.conf +- Add /etc/rc.d/init.d/sapconf and S99sapconf links in /etc/rc2.d, /etc/rc3.d, + and /etc/rc5.d +- Removed check_utilrpms() and defined the util rpms as dependency in the rpm + spec file +- Removed check_ibmjdk() + +* Thu Oct 18 2012 Sherry Yu - 0.91 +- Naming change from sap_prepare to sap-prepare +- Detailed log output +- In function virtrpms: for RHEV Hypervisor, recommend to check SAP Note + 1400911 for setting up host monitoring on RHEV +- New function check_utilrpms: install utility rpms used in the sap-prepare + script, e.g. syslinux rpm for gethostid() +- Add one section Recommendations at the end of the log file, containing + recommended changes that have to be carried out manually +- Add a Recommendations section at the end of the log file, for CHECK_ONLY + mode, that contains the recommended settings +- Add command-line argument "-h" for Help Message +- Move java rpms to variable JAVARPMS, as IBM JDK becomes obsolete on Oct. 2012 +- Add global variable VIRTRPMS +- Remove [-f config] argument in usage - recommended configurations are not to + be changed +- In check_fqdn: keep the backup file as + /etc/sysconfig/network.sap-prepare- +- In check_security add: if SELINUX=disabled in /etc/sysconfig/selinux, give + recommendation to set it to Permissive. If SELINUX=permissive but getenforce + returns 1, setenforce 0. For SELINUX=enforcing, to update the config file, + keep backup file as /etc/sysconfig/selinux.sap-prepare-; if + CHECK_ONLY==1, give recommendations +- Split check_rhn into check_rhn, check_rpms, check_ibmjdk, and check_links +- Add a variable SAP_NOTE_RHEL6 +- Remove check_users which is not used to keep the script clean +- Remove variable VERBOSE +- Rename prepare_environment to check_env, to be consistent with the naming + convention +- Move the code of setting kernel parameters from main body to check_env +- Add SYB_VARS +- In check_env add the setting of kernel parameters for Sybase +- In check_ntp ntpdate is removed as ntpd is preferred +- Remove update_limits_conf because it's no longer needed in RHEL6 + +* Thu Oct 04 2012 Markus Koch - 0.9 +- included config file in script, -d database option added, ntp check, hosts + check implemented + +* Wed Oct 03 2012 Markus Koch - 0.8 +- package renamed to sapprepare, vhostmd und logging added + +* Wed Apr 18 2012 Frank Danapfel - 0.6 +- bug fixes + +* Tue Feb 21 2012 Markus Koch - 0.5 +- initial working release +