[SOLVED] Can't change attributes on /etc/updatedb.conf
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On one of my CentOS 6 systems I get the following email every day:
Subject: Anacron job 'cron.daily' on localhost.localdomain
Body:
/etc/cron.daily/mlocate.cron:
/usr/bin/updatedb: can not open `/etc/updatedb.conf': Permission denied
I looked it up and every site I looked at said basically the same thing. You do an ls -lZ on /etc/updatedb.conf and it will look like this:
-rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/updatedb.conf
when it should look like this:
-rw-r--r--. root root unconfined_u:object_r:user_tmp_t:s0 /etc/updatedb.conf
To fix it, run restorecon -RFv /etc or restorecon -Fv /etc/updatedb.conf
I tried both. restorecon doesn't report any error (even when I run it with -vv), but the permissions(?) didn't change. When I searched for restorecon failures but found nothing relevant.
On one of my CentOS 6 systems I get the following email every day:
Subject: Anacron job 'cron.daily' on localhost.localdomain
Body:
/etc/cron.daily/mlocate.cron:
/usr/bin/updatedb: can not open `/etc/updatedb.conf': Permission denied
I looked it up and every site I looked at said basically the same thing. You do an ls -lZ on /etc/updatedb.conf and it will look like this:
-rw-r--r--. root root system_ubject_r:etc_t:s0 /etc/updatedb.conf
Those are the correct permissions and SELinux context for /etc/updatedb.conf in CentOS 6. What sites are telling you otherwise?
Thanks hydrurga! I've been in the industry for 25 years, but I started on DOS and have worked on Windows NT since its inception, but when it comes to Linux I'm still just getting my feet wet. :)
I'm feeling quite stupid right now. matchpathcon set me straight! I was looking at this sight and misinterpreted it: https://www.centos.org/forums/viewtopic.php?t=5249
I then compared the CentOS 6 system in question with another, and managed to toggle it there as well. The system reporting the error had unconfined_u:... The system working correctly had system_u:... I've now set the failing system's permissions to system_u:... I'll know for certain tomorrow but I believe I now have it fixed.
Thanks hydrurga! I've been in the industry for 25 years, but I started on DOS and have worked on Windows NT since its inception, but when it comes to Linux I'm still just getting my feet wet.
I'm feeling quite stupid right now. matchpathcon set me straight! I was looking at this sight and misinterpreted it: https://www.centos.org/forums/viewtopic.php?t=5249
I then compared the CentOS 6 system in question with another, and managed to toggle it there as well. The system reporting the error had unconfined_u:... The system working correctly had system_u:... I've now set the failing system's permissions to system_u:... I'll know for certain tomorrow but I believe I now have it fixed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.