When tuned is running in containerized environments such as OpenShift, dracut is not being used. Ignore errors when trying to run dracut as it might not exist on the system. Therefore, do not report ERRORs when running a custom profile script. This will prevent Tuned profiles in OpenShift going degraded. Resolves: OCPBUGS-79018 Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
33 lines
905 B
Bash
Executable file
33 lines
905 B
Bash
Executable file
#!/bin/bash
|
|
|
|
. /usr/lib/tuned/functions
|
|
|
|
start() {
|
|
DRACUT_VER=`dracut --version 2>/dev/null | sed 's/^.* \([0-9]\+\).*/\1/'`
|
|
echo "$DRACUT_VER" | grep -q '^[[:digit:]]\+$' || DRACUT_VER="0"
|
|
# https://issues.redhat.com/browse/RHEL-119889
|
|
if [ "$DRACUT_VER" -gt "102" ]
|
|
then
|
|
DRACUT_HOOK_DIR="/var/lib/dracut/hooks/pre-udev"
|
|
else
|
|
DRACUT_HOOK_DIR="/usr/lib/dracut/hooks/pre-udev"
|
|
fi
|
|
mkdir -p "${TUNED_tmpdir}/etc/systemd/system.conf.d"
|
|
mkdir -p "${TUNED_tmpdir}${DRACUT_HOOK_DIR}"
|
|
cp /etc/systemd/system.conf.d/00-tuned.conf "${TUNED_tmpdir}/etc/systemd/system.conf.d/00-tuned.conf"
|
|
cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}${DRACUT_HOOK_DIR}"
|
|
setup_kvm_mod_low_latency
|
|
disable_ksm
|
|
return "$?"
|
|
}
|
|
|
|
stop() {
|
|
if [ "$1" = "full_rollback" ]
|
|
then
|
|
teardown_kvm_mod_low_latency
|
|
enable_ksm
|
|
fi
|
|
return "$?"
|
|
}
|
|
|
|
process $@
|