From b854e01e4681ad334191f3f345f3e9dd66b300db Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 11 Aug 2015 17:07:51 +0200 Subject: [cpugovernor] No systemd error when machine does not support ondemand mode --- .../cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'remote') diff --git a/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor b/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor index 115163c7..f7aa255a 100755 --- a/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor +++ b/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor @@ -15,7 +15,7 @@ else # use 'ondemand' per default TARGET_GOVERNOR="ondemand" fi -echo "Setting governor to $TARGET_GOVERNOR" +echo "Trying to set CPU governor to $TARGET_GOVERNOR" # global information needed # CORES is the range of cores present, on bwpc4 it has the value '0-3' # thus the split: MINCORE=0 MAXCORE=3 @@ -39,7 +39,7 @@ test_for_gov() { local i=$MINCORE while [ $i -le $MAXCORE ]; do # check if the given governor is supported - grep -q "${GOVERNOR}" /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_governors || return 1; + grep -q "${GOVERNOR}" /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_governors 2>/dev/null || return 1; # increment true $(( i++ )) done @@ -58,5 +58,5 @@ if test_for_gov "${TARGET_GOVERNOR}"; then done else echo "ERROR: '${TARGET_GOVERNOR}' is not supported by this machine!" - exit 1 + exit 0 fi -- cgit v1.2.3-55-g7522