how to add script to custom tuned-adm profile?

Latest response

I'm using such tuned-adm profile:

cat /etc/tuned/myprofile/tuned.conf
[main]
include=network-latency

[bootloader]
cmdline = isolcpus=1-11 nohz_full=1-11

Now I want to add such script to this profile:
for i in pgrep rcuo ; do taskset -pc 0 $i ; done

How can I do this?

Responses

Plesae refer to https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/tuned-adm.html. Specific actions actions could be added to the ktune.sh scipt in your myprofile directory.

Thanks, this instructions are for RHEL6, i'm afraid they might be not applicable in RHEL7.1
In RHEL 7 Power Management guide I can not find mention of "ktune.sh"

In RHEL 6 it's recommended to start with this command line "cp -a /etc/tune-profiles/laptop-battery-powersave/ /etc/tune-profiles/myprofile" but I can not find "/etc/tune-profiles" folder in RHEL 7.

rpm -ql tuned
...
/usr/lib/tuned/balanced
/usr/lib/tuned/powersave
...

[root@vmt-rhel7-01:~]# cp -pr /usr/lib/tuned/powersave /usr/lib/tuned/test
[root@vmt-rhel7-01:~]# tuned-adm list
Available profiles:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- test

Thanks, note that doc suggests to use another place for custom profiles: "Do not change the profiles in /usr/lib/tuned. If you need to customize the profile, copy the profile directory to the /etc/tuned directory. This is the place for the custom profiles."

Also I have found that in RHEL7 I should use script.sh instead of ktune.sh. I've tried and it works!

[root@localhost ovazhnev]# cat /etc/tuned/myprofile/
script.sh tuned.conf
[root@localhost ovazhnev]# cat /etc/tuned/myprofile/tuned.conf
[main]
include=network-latency

[bootloader]
cmdline = isolcpus=1-13 nohz_full=1-13

[script]
script=script.sh
[root@localhost ovazhnev]# cat /etc/tuned/myprofile/script.sh

!/bin/sh

. /usr/lib/tuned/functions

start() {
for i in pgrep rcuo
do
taskset -pc 0 $i
done
return 0
}

stop() {
return 0
}

process $@

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.