@@ -678,10 +678,15 @@ EOF
678
678
if [ " ${CONFIGURE_TUNED} " != false ]; then
679
679
log " Setting up tuned profiles"
680
680
681
- [ ! -d /etc/tuned/el-eco ] && mkdir /etc/tuned/el-eco
682
- [ ! -d /etc/tuned/el-perf ]&& mkdir /etc/tuned/el-perf
681
+ if [ " ${RELEASE} " -eq 10 ]; then
682
+ TUNED_DIR=/etc/tuned/profiles
683
+ else
684
+ TUNED_DIR=/etc/tuned
685
+ fi
686
+ [ ! -d " ${TUNED_DIR} /el-eco" ] && mkdir -p " ${TUNED_DIR} /el-eco"
687
+ [ ! -d " ${TUNED_DIR} /el-eco" ]&& mkdir -p " ${TUNED_DIR} /el-perf"
683
688
684
- cat << 'EOF ' > /etc/tuned/ el-eco/tuned.conf
689
+ cat << 'EOF ' > "${TUNED_DIR}/ el-eco/tuned.conf"
685
690
[main]
686
691
summary=EL NetPerfect Powersaver
687
692
include=powersave
@@ -721,9 +726,9 @@ vm.dirty_writeback_centisecs = 100
721
726
#script=\${i:PROFILE_DIR}/script.sh
722
727
script=script.sh
723
728
EOF
724
- [ $? -ne 0 ] && log " Failed to create /etc/tuned /el-eco/tuned.conf" " ERROR"
729
+ [ $? -ne 0 ] && log " Failed to create ${TUNED_DIR} /el-eco/tuned.conf" " ERROR"
725
730
726
- cat << 'EOF ' > /etc/tuned/ el-perf/tuned.conf
731
+ cat << 'EOF ' > "${TUNED_DIR}/ el-perf/tuned.conf"
727
732
[main]
728
733
summary=EL NetPerfect Performance
729
734
include=network-latency
@@ -763,9 +768,9 @@ vm.dirty_writeback_centisecs = 100
763
768
#script=\${i:PROFILE_DIR}/script.sh
764
769
script=script.sh
765
770
EOF
766
- [ $? -ne 0 ] && log " Failed to create /etc/tuned /el-perf/tuned.conf" " ERROR"
771
+ [ $? -ne 0 ] && log " Failed to create ${TUNED_DIR} /el-perf/tuned.conf" " ERROR"
767
772
768
- cat << 'EOF ' > /etc/tuned/ el-eco/script.sh
773
+ cat << 'EOF ' > "${TUNED_DIR}/ el-eco/script.sh"
769
774
#!/usr/bin/env bash
770
775
771
776
SCRIPT_VER=2024040701
@@ -801,9 +806,9 @@ cpupower idle-set -E
801
806
# Disable any higher than 50ns latency idle states
802
807
cpupower idle-set -D 50
803
808
EOF
804
- [ $? -ne 0 ] && log " Failed to create /etc/tuned /el-eco/script.sh" " ERROR"
809
+ [ $? -ne 0 ] && log " Failed to create ${TUNED_DIR} /el-eco/script.sh" " ERROR"
805
810
806
- cat << 'EOF ' > /etc/tuned/ el-perf/script.sh
811
+ cat << 'EOF ' > "${TUNED_DIR}/ el-perf/script.sh"
807
812
#!/usr/bin/env bash
808
813
809
814
SCRIPT_VER=2024040701
@@ -835,7 +840,7 @@ cpupower idle-set -E
835
840
# Disable any higher than 50ns latency idle states
836
841
cpupower idle-set -D 50
837
842
EOF
838
- [ $? -ne 0 ] && log " Failed to create /etc/tuned /el-perf/script.sh" " ERROR"
843
+ [ $? -ne 0 ] && log " Failed to create ${TUNED_DIR} /el-perf/script.sh" " ERROR"
839
844
840
845
chmod +x /etc/tuned/{el-eco,el-perf}/script.sh 2>> " ${LOG_FILE} " || log " Failed to chmod on tuned scripts" " ERROR"
841
846
fi
@@ -1100,6 +1105,7 @@ if [ "${ALLOW_SUDO}" = true ] && [ "${SCAP_PROFILE}" != false ]; then
1100
1105
sed -i ' s/^Defaults noexec/#Defaults noexec/g' /etc/sudoers 2>> " ${LOG_FILE} " || log " Failed to sed /etc/sudoers" " ERROR"
1101
1106
if [ " ${FLAVOR} " = " rhel" ]; then
1102
1107
dnf install -y sudo 2>> " ${LOG_FILE} " || log " Failed to install sudo" " ERROR"
1108
+ # chmod 4111 /usr/bin/sudo is not needed on RHEL normally
1103
1109
elif [ " ${FLAVOR} " = " debian" ]; then
1104
1110
apt install -y sudo 2>> " ${LOG_FILE} " || log " Failed to install sudo" " ERROR"
1105
1111
chmod 4755 /usr/bin/sudo 2>> " ${LOG_FILE} " || log " Failed to chmod /usr/bin/sudo" " ERROR"
0 commit comments