Skip to content

Commit d8597be

Browse files
committed
fix(tuned): remove sudo it is already root
1 parent 0332f89 commit d8597be

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tuned/skyhook_dir/apply_tuned_profile.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ TUNED_DIR="/etc/tuned"
2929
SCRIPTS_DIR="/etc/tuned/scripts"
3030

3131
# ensure tuned directory exists
32-
sudo mkdir -p "$TUNED_DIR"
33-
sudo mkdir -p "$SCRIPTS_DIR"
32+
mkdir -p "$TUNED_DIR"
33+
mkdir -p "$SCRIPTS_DIR"
3434

3535
# First, deploy all scripts ending with "_script" to the shared scripts directory
3636
echo "Deploying scripts to $SCRIPTS_DIR..."
@@ -46,8 +46,8 @@ for file in "$CONFIGMAP_DIR"/*_script; do
4646
fi
4747

4848
# Copy the script and make it executable
49-
sudo cp "$file" "$script_path"
50-
sudo chmod +x "$script_path"
49+
cp "$file" "$script_path"
50+
chmod +x "$script_path"
5151
echo "deployed script: $script_name -> $script_path"
5252
done
5353

@@ -62,10 +62,10 @@ for file in "$CONFIGMAP_DIR"/*; do
6262
custom_profile_dir="$TUNED_DIR/$profile_name"
6363

6464
# Create a directory for the custom profile if it doesn't exist
65-
sudo mkdir -p "$custom_profile_dir"
65+
mkdir -p "$custom_profile_dir"
6666

6767
# Copy the file contents as tuned.conf
68-
sudo cp "$file" "$custom_profile_dir/tuned.conf"
68+
cp "$file" "$custom_profile_dir/tuned.conf"
6969
echo "created custom tuned profile: $profile_name"
7070
done
7171

@@ -93,7 +93,7 @@ if [ -f "$TUNED_PROFILE_FILE" ]; then
9393

9494
echo "applying tuned profile(s): $tuned_profiles"
9595
# shellcheck disable=SC2086
96-
sudo tuned-adm profile $tuned_profiles
96+
tuned-adm profile $tuned_profiles
9797
else
9898
echo "WARNING: no tuned_profile file found in $CONFIGMAP_DIR"
9999
fi

0 commit comments

Comments
 (0)