-
Notifications
You must be signed in to change notification settings - Fork 42
RHEL/CentOS: Update SELinux Contexts without Rebooting by Using setfiles Command #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RHEL/CentOS: Update SELinux Contexts without Rebooting by Using setfiles Command #788
Conversation
…d of touch /.autorelabel
@Poorna-Gottimukkula1 this works irrespective of the environment’s selinux settings(disabled , permissive and enforcing) ? |
Yes, tested RHEL-9.6 with various selinux settings(disabled , permissive and enforcing).
I don't see any issue, regardless of the environment's SELinux settings (image build VM). |
Approximately how much time we can save with this change? |
Around 1.5 - 2 m I just triggered the OCP deploy using the newly created image.
Previous three jobs took around 4m42s
|
This is just wow!
|
@sudeeshjohn can you review and merge this PR if all okay? |
@Poorna-Gottimukkula1 did you test this for rhel10 ? |
I haven’t tested it on RHEL-10 yet. the image build works fine, I’ll test the image and update here once it’s done. |
Tested this on RHEL-10
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
for @sudeeshjohn to give a final ack and merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkumatag, Poorna-Gottimukkula1, sudeeshjohn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Tested this on 8.10 as well.
|
/unhold |
This PR update setup script to avoid a reboot when updating SELinux contexts. The change replaces the
touch /.autorelabel
command withsetfiles -F /etc/selinux/targeted/contexts/files/file_contexts /
, which applies the required SELinux file context updates without needing a system reboot. This reduces setup time and eliminates the need for an additional system restart after completing the setup