Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2174902

Summary: /.autorelabel leads to selinux-autorelabel.service failure status
Product: Red Hat Enterprise Linux 8 Reporter: Orion Poplawski <orion>
Component: policycoreutilsAssignee: Vit Mojzis <vmojzis>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.7CC: dwalsh, lvrabec, mmalik, plautrba, ssekidde, vmojzis
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-03 07:58:33 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 Orion Poplawski 2023-03-02 15:21:15 UTC
Description of problem:

Did touch /.autorelabel and rebooted.  selinux-autorelabel.service reports a status of failed.

Version-Release number of selected component (if applicable):
policycoreutils-2.9-20.el8.x86_64

How reproducible:
Very

Actual results:
Mar 02 07:00:10 host systemd[1]: Starting Relabel all filesystems...
Mar 02 07:00:10 host selinux-autorelabel[735]: *** Warning -- SELinux targeted policy relabel is required.
Mar 02 07:00:10 host selinux-autorelabel[735]: *** Relabeling could take a very long time, depending on file
Mar 02 07:00:10 host selinux-autorelabel[735]: *** system size and speed of hard drives.
Mar 02 07:00:45 host selinux-autorelabel[1391]: libsemanage.add_user: user cameron-admin not in password file
Mar 02 07:00:45 host selinux-autorelabel[1391]: libsemanage.add_user: user crowe.brian not in password file
Mar 02 07:00:45 host selinux-autorelabel[1391]: libsemanage.add_user: user orion-admin not in password file
Mar 02 07:00:46 host selinux-autorelabel[743]: Warning: Skipping the following R/O filesystems:
Mar 02 07:00:46 host selinux-autorelabel[743]: /sys/fs/cgroup
Mar 02 07:00:46 host selinux-autorelabel[743]: Relabeling / /dev /dev/hugepages /dev/mqueue /dev/pts /dev/shm /run /sys /sys/fs/cgroup/blkio /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuset /sys/fs/cgroup/devices /sys/fs/cgroup/freezer /sys/fs/cgroup/hugetlb /sys/fs/cgroup/memory /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/perf_event /sys/fs/cgroup/pids /sys/fs/cgroup/rdma /sys/fs/cgroup/systemd /sys/fs/pstore /sys/kernel/debug /sys/kernel/tracing /tmp
Mar 02 07:03:27 host selinux-autorelabel[1398]: Warning no default label for /dev/mqueue
Mar 02 07:03:27 host selinux-autorelabel[743]: Cleaning up labels on /tmp
Mar 02 07:03:27 host selinux-autorelabel[1430]: Failed to connect to bus: No such file or directory
Mar 02 07:03:27 host systemd[1]: selinux-autorelabel.service: Main process exited, code=killed, status=15/TERM
Mar 02 07:03:27 host systemd[1]: selinux-autorelabel.service: Failed with result 'signal'.
Mar 02 07:03:27 host systemd[1]: Stopped Relabel all filesystems.

Expected results:
No failure status

Comment 1 Petr Lautrbach 2023-03-02 15:35:51 UTC
Please note that autorelabel is supposed to be run in permissive mode. There's no guarantee it would work in enforcing mode - when a system labels are misconfigured it could be blocked by SELinux, see https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_selinux/changing-selinux-states-and-modes_using-selinux :

    Before rebooting the system for relabeling, make sure the system will boot in permissive mode, for example by using the enforcing=0 kernel option. This prevents the system from failing to boot in case the system contains unlabeled files required by systemd before launching the selinux-autorelabel service. For more information, see RHBZ#2021835.

Comment 2 Orion Poplawski 2023-03-02 18:48:09 UTC
With booting into permissive mode I don't see the error.  Thank you.  Sorry for the noise.