Bug 1351937

Summary: fix conditional support for grub2 in RPM post scriplets
Product: [Fedora] Fedora Reporter: dac.override
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: jskarvad, jv+fedora, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.7.0-2.fc24 tuned-2.7.0-2.fc23 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 18:51:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dac.override 2016-07-01 08:15:49 UTC
Description of problem:

cp -a /usr/share/tuned/grub2/00_tuned /etc/grub.d/00_tuned

This will copy that file and leaves its selinux label as it was. This causes issues since "data" is not executable. Thus grub2-mkconfig (anything that is targeted by selinux for that matter) will not be able to execute this script

A solution would be to run restorecon on the target afterwards.

example:

if [ -d /etc/grub.d ]; then
  cp -a /usr/share/tuned/grub2/00_tuned /etc/grub.d/00_tuned
  restorecon /etc/grub.d/00_tuned
fi

That will make sure that the labeling is consistent with the policy

Version-Release number of selected component (if applicable):

any

Comment 1 dac.override 2016-07-01 08:40:55 UTC
This might be a little better:

selinuxenabled && restorecon /etc/grub.d/00_tuned

That will only try to reset labels if selinux is actually enabled.

Comment 2 Jaroslav Škarvada 2016-07-01 17:03:59 UTC
Thanks for the report, upstream commit fixing the problem:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=ddeadd34eb126d77fc9977eb64b56398fda3ee72

I will rebase the package in fedora soon.

I fixed it optionally:
  selinuxenabled && restorecon %{_sysconfdir}/grub.d/00_tuned || :
to handle cases where no selinux support utilities are installed.

Comment 3 Fedora Update System 2016-07-19 14:10:49 UTC
tuned-2.7.0-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-327cccfbae

Comment 4 Fedora Update System 2016-07-19 14:13:30 UTC
tuned-2.7.0-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-122381bf6f

Comment 5 Fedora Update System 2016-07-20 01:49:07 UTC
tuned-2.7.0-1.fc23 has been pushed to the Fedora 23 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-2016-122381bf6f

Comment 6 Fedora Update System 2016-07-20 01:53:10 UTC
tuned-2.7.0-1.fc24 has been pushed to the Fedora 24 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-2016-327cccfbae

Comment 7 Fedora Update System 2016-07-21 15:54:33 UTC
tuned-2.7.0-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f2b0ad383e

Comment 8 Fedora Update System 2016-07-21 15:55:14 UTC
tuned-2.7.0-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3acc8e3722

Comment 9 Fedora Update System 2016-07-22 19:21:57 UTC
tuned-2.7.0-2.fc23 has been pushed to the Fedora 23 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-2016-3acc8e3722

Comment 10 Fedora Update System 2016-07-22 19:22:01 UTC
tuned-2.7.0-2.fc24 has been pushed to the Fedora 24 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-2016-f2b0ad383e

Comment 11 Jan Kurik 2016-07-26 04:28:24 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 12 Fedora Update System 2016-07-27 18:51:32 UTC
tuned-2.7.0-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-08-01 18:53:20 UTC
tuned-2.7.0-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.