LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-26-2016, 10:55 AM   #1
ghamilton
LQ Newbie
 
Registered: Feb 2015
Location: Columbia, SC
Posts: 12

Rep: Reputation: 2
Question Can't change attributes on /etc/updatedb.conf


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.

Any ideas on why this is happening?

Thanks,
Gregg
 
Old 02-26-2016, 11:09 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by ghamilton View Post
On one of my CentOS 6 systems...
I'd hesitate to call you a newbie...

Have you tried matchpathcon -V to check that the default context for the file is as you think it is?
 
1 members found this post helpful.
Old 02-26-2016, 11:32 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by ghamilton View Post
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?

Are you seeing SELinux denials logged for this?
 
1 members found this post helpful.
Old 02-26-2016, 12:03 PM   #4
ghamilton
LQ Newbie
 
Registered: Feb 2015
Location: Columbia, SC
Posts: 12

Original Poster
Rep: Reputation: 2
Thumbs up

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.
 
Old 02-26-2016, 12:05 PM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by ghamilton View Post
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.
Great. Good luck, and let us know either way.
 
Old 02-29-2016, 10:01 AM   #6
ghamilton
LQ Newbie
 
Registered: Feb 2015
Location: Columbia, SC
Posts: 12

Original Poster
Rep: Reputation: 2
Thumbs up

No more emails! Thanks guys.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 14.0 is missing /run in PRUNEPATHS in /etc/updatedb.conf jtsn Slackware 4 01-05-2013 10:09 AM
[SOLVED] updatedb.conf slocate configuration PRUNEFS & PRUNEPATHS bearsssausage Slackware 2 07-20-2012 11:40 AM
updatedb.conf: how to add nfs drive? Kropotkin Linux - Software 1 01-22-2010 05:49 PM
Can I change the time of the automatic updatedb? wuqso Linux - General 4 01-07-2006 04:22 PM
how to configure updatedb.conf file for NFS sub-directory ursidious Linux - Newbie 1 04-05-2005 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration