CentOS6.5 `/etc/updatedb.conf‘: Permission denied

Posted Walkman

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS6.5 `/etc/updatedb.conf‘: Permission denied相关的知识,希望对你有一定的参考价值。

安装了CentOS6.5,使用root用户运行,每个一段时间,终端会提示:

You have new mail in /var/spool/mail/root

mail进入查看发现以下邮件内容:

[[email protected] ~]# mail 
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/root": 18 messages 18 unread
>U  1 Anacron               Sun Aug 12 14:10  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  2 Anacron               Mon Aug 13 03:47  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  3 Anacron               Tue Aug 14 03:37  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  4 Anacron               Wed Aug 15 03:34  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  5 Anacron               Thu Aug 16 03:23  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  6 Anacron               Fri Aug 17 03:44  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  7 Anacron               Sat Aug 18 03:31  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  8 Anacron               Sun Aug 19 04:26  18/636   "Anacron job ‘cron.daily‘ on node2"
 U  9 Anacron               Mon Aug 20 03:50  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 10 Anacron               Tue Aug 21 03:08  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 11 Anacron               Wed Aug 22 03:06  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 12 Anacron               Thu Aug 23 03:26  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 13 Anacron               Fri Aug 24 03:45  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 14 Anacron               Sat Aug 25 03:41  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 15 Anacron               Sun Aug 26 04:50  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 16 Anacron               Mon Aug 27 03:11  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 17 Anacron               Tue Aug 28 03:38  18/636   "Anacron job ‘cron.daily‘ on node2"
 U 18 Anacron               Wed Aug 29 03:17  18/636   "Anacron job ‘cron.daily‘ on node2"
& 2
Message  2:
From [email protected]  Mon Aug 13 03:47:01 2018
Return-Path: <[email protected]>
X-Original-To: root
Delivered-To: [email protected]
From: Anacron <[email protected]>
To: [email protected]
Content-Type: text/plain; charset="ANSI_X3.4-1968"
Subject: Anacron job cron.daily on node2
Date: Mon, 13 Aug 2018 03:47:01 +0800 (CST)
Status: RO

/etc/cron.daily/mlocate.cron:

/usr/bin/updatedb: can not open `/etc/updatedb.conf: Permission denied

&

查看文件权限:

[[email protected] ~]# ls -lZ /etc/updatedb.conf
-rw-r--r--. root root unconfined_u:object_r:user_tmp_t:s0 /etc/updatedb.conf

由于SElinux引起,重置设置,修复

[[email protected] ~]# restorecon -RFv /etc/updatedb.conf
restorecon reset /etc/updatedb.conf context unconfined_u:object_r:user_tmp_t:s0->system_u:object_r:etc_t:s0
[[email protected] ~]# ls -lZ /etc/updatedb.conf
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/updatedb.conf
Done

以上是关于CentOS6.5 `/etc/updatedb.conf‘: Permission denied的主要内容,如果未能解决你的问题,请参考以下文章

linux下手动更新locate所在数据库的指令updatedb为啥行不通

文件操作

Linux 文件搜索命令

linux命令学习

Linux之locate命令

linux 文件搜索命令