tuned icon indicating copy to clipboard operation
tuned copied to clipboard

sysctl settings of included profiles don't work after tuned-2.12.0

Open MintMana opened this issue 4 years ago • 3 comments

System: CentOS 8.1 with all updates (This bug also can be reproduced on RHEL 8.1)

profile: /etc/tuned/test/tuned.conf [main] include=virtual-guest summary=test

[sysctl] type=sysctl replace=1 net.ipv4.ip_forward = 1 net.ipv4.conf.all.rp_filter = 0 net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0

vm.swappiness should be set to 30 according to the include profile 'virtual-guest', however, it is set to 60 which is the default value after a reboot.

I have checked all change logs after 2.10.0 and found that it might be a bug which hasn't been not reported at bugzilla.

The snapshot version also contains this bug. https://download.copr.fedorainfracloud.org/results/packit/redhat-performance-tuned-239/epel-8-x86_64/01139349-tuned/

If tuned was rolled back to 2.10.0 or /usr/sbin/tuned was replace by that version ,all sysctl parameters seem to be correctly applied normally.

The debug logs simply indicate that the extra sysctl parameters from the profile included is not applied.

BTW, please suggest any workaround besides update tuned or roll back to 2.10.0 if possible.

MintMana avatar Mar 04 '20 11:03 MintMana

vm.swappiness should be set to 30 according to the include profile 'virtual-guest', however, it is set to 60 which is the default value after a reboot.

You're using replace=1 in your profile in the sysctl section, which means that all sysctl settings from the virtual-guest profile will be ignored. So I think it works as intended.

olysonek avatar Mar 04 '20 12:03 olysonek

@olysonek Thanks a lot for your reply. It seems that I have misunderstood the meaning of replace in the man page. I used to believe that only the conflicted parameters in the sysctl section of the included profile would be ignored. For instance, if vm.swappiness is also defined in the 'test' profile, the value of vm.swappiness in the 'virtual-guest' profile would be ignored. Actually, the whole section of sysctl is designed to be ignored. It seemed that the keyword replace didn't work in 2.10.0 from my result of tests. Therefore, the function of replace is fixed in 2.12.0?

MintMana avatar Mar 05 '20 03:03 MintMana

I used to believe that only the conflicted parameters in the sysctl section of the included profile would be ignored. For instance, if vm.swappiness is also defined in the 'test' profile, the value of vm.swappiness in the 'virtual-guest' profile would be ignored.

If there's a conflict, the value from the child profile (test in this case) is always used. You don't need replace for that.

It seemed that the keyword replace didn't work in 2.10.0 from my result of tests. Therefore, the function of replace is fixed in 2.12.0?

Hmm, I can confirm I'm seeing the same thing. It seems it got fixed, but I don't know how. I see no related changes.

olysonek avatar Mar 05 '20 09:03 olysonek