add script to check service tuned for aliyunlinux2

Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
This commit is contained in:
haoshuwei
2020-08-05 10:51:37 +08:00
parent f85923cadc
commit a65306d1c9
2 changed files with 15 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
"variables": {
"region": "cn-hangzhou",
"image_name": "test_image{{timestamp}}",
"source_image": "aliyun_2_1903_x64_20G_uefi_alibase_20200616.vhd",
"source_image": "aliyun_2_1903_x64_20G_alibase_20200529.vhd",
"instance_type": "ecs.g6.large",
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
"secret_key": "{{env `ALICLOUD_SECRET_KEY`}}"
@@ -29,6 +29,7 @@
"scripts/reboot.sh",
"scripts/cleanUpKerneles.sh",
"config/default.sh",
"scripts/disableTuned.sh",
"scripts/verify.sh"
],
"expect_disconnect": true

13
scripts/disableTuned.sh Normal file
View File

@@ -0,0 +1,13 @@
#! /bin/bash
# check if image_id="aliyun_2_1903_x64_20G_alibase_20200529.vhd" and tuned service is off
if [ -f "/etc/image-id" ]; then
image_id=$(cat /etc/image-id |grep image_id |cut -d "=" -f2)
if [ "$image_id" = "\"aliyun_2_1903_x64_20G_alibase_20200526.vhd\"" ] || [ "$image_id" = "\"aliyun_2_1903_x64_20G_alibase_20200529.vhd\"" ]; then
systemctl stop tuned
systemctl disable tuned
echo "Succesfully stop and disable tuned"
fi
fi