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.
Description of problem:
If the cachefiles module is not loaded the /dev/cachefiles device does not exist. This causes the cachefiles initscript to fail at line 60 when setting security contexts for selinux.
Version-Release number of selected component (if applicable):
cachefilesd-0.10.2-1.el6.x86_64
initscripts-9.03.40-2.el6.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Set SELinux to enforcing mode
2. Unload the cachefiles module or ensure it's unloaded
3. Start cachefilesd:
# service cachefilesd start
Actual results:
Cachefilesd fails to start with the following error:
# service cachefilesd start
Starting cachefilesd: /sbin/restorecon: lstat(/dev/cachefiles) failed: No such file or directory
Expected results:
cachefilesd starts successfully
Additional info:
- Can easily be worked around by loading the module manually before starting.
- I've attached a modified initscript file which re-orders the security context settings and the module loading so that the module is loaded before selinux contexts are set. This appears to fix the issue:
[root@scooby ~]# modprobe -r cachefiles
[root@scooby ~]# setenforce 1
[root@scooby ~]# service cachefilesd start
Starting cachefilesd: [ OK ]
Relevant lines:
57 +
58 + # Set security contexts
59 + /sbin/restorecon /sbin/cachefilesd || return 1
60 + /sbin/restorecon /dev/cachefiles || return 1
61 + /sbin/restorecon -R `awk -- '/^dir/ { print $2 }' $CONFFILE` || return 1
57 62
58 63 # Load the cachefiles module if needed
59 64 [ -x "$MODPROBE" ] && {
60 65 if ! /sbin/lsmod | grep cachefiles > /dev/null ; then
61 66 $MODPROBE cachefiles $MODPROBE_ARGS || return 1
62 67 fi
63 68 }
64 -
65 - # Set security contexts
66 - /sbin/restorecon /sbin/cachefilesd || return 1
67 - /sbin/restorecon /dev/cachefiles || return 1
68 - /sbin/restorecon -R `awk -- '/^dir/ { print $2 }' $CONFFILE` || return 1
I think it's not working... I've just installed in CentOS 6 (2.6.32-573.8.1.el6.x86_64), the fix is present in /etc/init.d/cachefilesd, but still gives the error.
The code should be like this:
# Set security contexts
/sbin/restorecon /sbin/cachefilesd || return 1
/sbin/restorecon -R `awk -- '/^dir/ { print $2 }' $CONFFILE` || return 1
# Load the cachefiles module if needed
[ -x "$MODPROBE" ] && {
if ! /sbin/lsmod | grep cachefiles > /dev/null ; then
$MODPROBE cachefiles $MODPROBE_ARGS || return 1
fi
}
/sbin/restorecon /dev/cachefiles || return 1
because /dev/cachefiles will not appear until the module is loaded.
The error you say is still happening is:
Starting cachefilesd: /sbin/restorecon: lstat(/dev/cachefiles) failed: No
such file or directory
right? Can you stick set -x / set +x around the section of the script in question?
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://rhn.redhat.com/errata/RHBA-2016-0975.html
Description of problem: If the cachefiles module is not loaded the /dev/cachefiles device does not exist. This causes the cachefiles initscript to fail at line 60 when setting security contexts for selinux. Version-Release number of selected component (if applicable): cachefilesd-0.10.2-1.el6.x86_64 initscripts-9.03.40-2.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Set SELinux to enforcing mode 2. Unload the cachefiles module or ensure it's unloaded 3. Start cachefilesd: # service cachefilesd start Actual results: Cachefilesd fails to start with the following error: # service cachefilesd start Starting cachefilesd: /sbin/restorecon: lstat(/dev/cachefiles) failed: No such file or directory Expected results: cachefilesd starts successfully Additional info: - Can easily be worked around by loading the module manually before starting. - I've attached a modified initscript file which re-orders the security context settings and the module loading so that the module is loaded before selinux contexts are set. This appears to fix the issue: [root@scooby ~]# modprobe -r cachefiles [root@scooby ~]# setenforce 1 [root@scooby ~]# service cachefilesd start Starting cachefilesd: [ OK ] Relevant lines: 57 + 58 + # Set security contexts 59 + /sbin/restorecon /sbin/cachefilesd || return 1 60 + /sbin/restorecon /dev/cachefiles || return 1 61 + /sbin/restorecon -R `awk -- '/^dir/ { print $2 }' $CONFFILE` || return 1 57 62 58 63 # Load the cachefiles module if needed 59 64 [ -x "$MODPROBE" ] && { 60 65 if ! /sbin/lsmod | grep cachefiles > /dev/null ; then 61 66 $MODPROBE cachefiles $MODPROBE_ARGS || return 1 62 67 fi 63 68 } 64 - 65 - # Set security contexts 66 - /sbin/restorecon /sbin/cachefilesd || return 1 67 - /sbin/restorecon /dev/cachefiles || return 1 68 - /sbin/restorecon -R `awk -- '/^dir/ { print $2 }' $CONFFILE` || return 1