RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1461279 - Heredity of cmdline works wrong when using 'replace=false'
Summary: Heredity of cmdline works wrong when using 'replace=false'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Tereza Cerna
URL:
Whiteboard:
Depends On:
Blocks: 1465887 TUNED-7.5-REBASE 1485946
TreeView+ depends on / blocked
 
Reported: 2017-06-14 06:29 UTC by Tereza Cerna
Modified: 2018-04-10 16:04 UTC (History)
4 users (show)

Fixed In Version: tuned-2.9.0-0.1.rc1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 16:04:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0879 0 normal SHIPPED_LIVE tuned bug fix and enhancement update 2018-04-10 13:39:08 UTC

Description Tereza Cerna 2017-06-14 06:29:46 UTC
Description of problem:
=======================
Bootloader plugin for heredity of cmdline with addition/overwrite doesn't work as expected. 

When user uses rule 'replace=false' in child profile, all parents parameters were inherited to child. Then user wants to remove some rule from parent profile with using '=-', but this rules are still there and it should not be there. See reproducer and results.

Version-Release number of selected component:
=============================================
tuned-2.8.0-4.el7.noarch

How reproducible:
=================
always

Steps to Reproduce:
===================
1. Create a parent profile:
   # cat /usr/lib/tuned/parent-profile/tuned.conf 
   [bootloader]
   cmdline=quiet noexec=on intel_pstate=disable

2. Create a child profile:
   # cat /usr/lib/tuned/child-profile/tuned.conf 
   [main]
   include=parent-profile

   [bootloader]
   replace=false
   cmdline1=+nosoftlockup
   cmdline2=-quiet intel_pstate=disable
   cmdline3=nmi_watchdog=1

3. Activate child profile:
   # tuned-adm profile child-profile

Actual results:
===============
# grep 'set tuned_params=' /boot/grub2/grub.cfg
set tuned_params="quiet noexec=on intel_pstate=disable nosoftlockup nmi_watchdog=1"

Expected results:
=================
# grep 'set tuned_params=' /boot/grub2/grub.cfg
set tuned_params="noexec=on nosoftlockup nmi_watchdog=1"

Additional info:
================
Founded in automated test case /CoreOS/tuned/Regression/add-bootloader-plugin-for-heredity-of-cmdline-options

Comment 2 Tereza Cerna 2017-06-14 06:36:33 UTC
Info for QA:
This bug was found in automated test case /CoreOS/tuned/Regression/add-bootloader-plugin-for-heredity-of-cmdline-options in phase 'TEST 3'

Comment 3 Jaroslav Škarvada 2017-06-14 14:07:19 UTC
I am currently not sure whether it's actually bug. The line "cmdline2=-quiet intel_pstate=disable" tries to match and remove string "quiet intel_pstate=disable" which is not there, the following will do the trick:

# cat /usr/lib/tuned/child-profile/tuned.conf 
[main]
include=parent-profile

[bootloader]
replace=false
cmdline1=+nosoftlockup
cmdline2=-quiet
cmdline2.5=-intel_pstate=disable
cmdline3=nmi_watchdog=1

I.e. it will try to remove strings "quiet" and "intel_pstate=disable". Of course we could learn the plugin to automatically split it which will be probably more user friendly.

Comment 4 Jaroslav Škarvada 2017-06-14 14:43:10 UTC
RFE implemented upstream:
https://github.com/redhat-performance/tuned/commit/f068a031a820ae48426cb8c99e38a8873988a570

Comment 6 Ondřej Lysoněk 2017-07-04 09:04:01 UTC
Actually it's not a bug, it's meant to be a feature :). The reason I implemented it this way is to account for the following:

# cat /usr/lib/tuned/parent-profile/tuned.conf 
[bootloader]
cmdline=some_option 1 other_option 1

# cat /usr/lib/tuned/child-profile/tuned.conf 
[main]
include=parent-profile

[bootloader]
cmdline1=-other_option 1


Where the '1' belongs to the options 'some_option' and 'other_option'. After applying the child profile with the new implementation, you would get 'cmdline=some_option', which is not what you want. I'm not sure if such options exist in the kernel though.

Comment 7 Jaroslav Škarvada 2017-07-04 09:39:11 UTC
(In reply to Ondřej Lysoněk from comment #6)
> Actually it's not a bug, it's meant to be a feature :). The reason I
> implemented it this way is to account for the following:
> 
> # cat /usr/lib/tuned/parent-profile/tuned.conf 
> [bootloader]
> cmdline=some_option 1 other_option 1
> 
> # cat /usr/lib/tuned/child-profile/tuned.conf 
> [main]
> include=parent-profile
> 
> [bootloader]
> cmdline1=-other_option 1
> 
> 
> Where the '1' belongs to the options 'some_option' and 'other_option'. After
> applying the child profile with the new implementation, you would get
> 'cmdline=some_option', which is not what you want. I'm not sure if such
> options exist in the kernel though.

I thought it's not a bug. If I am not mistaken it should be safe to split the cmdline by spaces (and also more user friendly). IMHO the cmdline is free text, interpreted by dracut, it's scripts, kernel modules (or builtins) and AFAIK space is taken as a separator. At the moment I am not aware of anything interpreting it different way, but of course such thing can exists. To be 100% safe we could add modifier for not doing the auto-split.

Comment 8 Fedora Update System 2017-10-13 14:20:42 UTC
tuned-2.9.0-0.1.rc1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9c6b990df

Comment 10 Fedora Update System 2017-10-13 22:25:08 UTC
tuned-2.9.0-0.1.rc1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9c6b990df

Comment 11 Fedora Update System 2017-10-13 23:24:56 UTC
tuned-2.9.0-0.1.rc1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5f0849d207

Comment 12 Fedora Update System 2017-10-29 21:06:55 UTC
tuned-2.9.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0e45ce4685

Comment 13 Fedora Update System 2017-10-29 21:13:02 UTC
tuned-2.9.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c30e9bd1ea

Comment 14 Tereza Cerna 2018-01-05 11:35:26 UTC
============================
Verified in:
    tuned-2.9.0-1.el7.noarch
PASS
============================

:: [   LOG    ] :: ===== Apply child profile =====
:: [   PASS   ] :: Command 'tuned-adm profile test3-child-profile' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep ERROR /var/log/tuned/tuned.log' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep 'set tuned_params=' /boot/grub2/grub.cfg > output' (Expected 0, got 0)
:: [   LOG    ] :: There should be: noexec=on nosoftlockup nmi_watchdog=1
:: [   PASS   ] :: Command 'grep noexec=on output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep nosoftlockup output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep nmi_watchdog=1 output' (Expected 0, got 0)
:: [   LOG    ] :: There shouldn't be: intel_pstate=disable quiet
:: [   PASS   ] :: Command 'grep intel_pstate=disable output' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep quiet output' (Expected 1, got 1)

============================
Reproduced in:
    tuned-2.8.0-5.el7.noarch
FAIL
============================

:: [   LOG    ] :: ===== Apply child profile =====
:: [   PASS   ] :: Command 'tuned-adm profile test3-child-profile' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep ERROR /var/log/tuned/tuned.log' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep 'set tuned_params=' /boot/grub2/grub.cfg > output' (Expected 0, got 0)
:: [   LOG    ] :: There should be: noexec=on nosoftlockup nmi_watchdog=1
:: [   PASS   ] :: Command 'grep noexec=on output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep nosoftlockup output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep nmi_watchdog=1 output' (Expected 0, got 0)
:: [   LOG    ] :: There shouldn't be: intel_pstate=disable quiet
:: [   FAIL   ] :: Command 'grep intel_pstate=disable output' (Expected 1, got 0)
:: [   FAIL   ] :: Command 'grep quiet output' (Expected 1, got 0)

Comment 17 errata-xmlrpc 2018-04-10 16:04:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0879


Note You need to log in before you can comment on or make changes to this bug.