Blame SOURCES/sapconf-use-systemct-instead-service-and-chkconfig.patch

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