ADJ網路實驗室
打印

[介紹] 解決 restorecond錯誤 : Will not restore a file with more than one hard link

解決 restorecond錯誤 : Will not restore a file with more than one hard link

如果在 /var/log/message 出現這樣的錯誤訊息:
restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory

那是因為在CentOS或RHEL中...
/etc/sysconfig/networking/profiles/default/resolv.conf 是hard link 到/etc/resolv.conf,我們可以透過下列指令找出全部的hard link
(1) #find / -xdev -samefile /etc/resolv.conf

輸出結果大致如下:
(1)
/etc/sysconfig/networking/profiles/default/resolv.conf
/etc/resolv.conf

解決方法,用root權限依序執行下列步驟即可:
引用:

(1)
#rm /etc/sysconfig/networking/profiles/default/resolv.conf
(2)
#restorecon /etc/resolv.conf
(3)
#ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf


如果你沒有開啟 SELinux 的話...其實你可以關閉這個服務...
#chkconfig restorecond off
#service restorecond stop

這樣就不會執行啦~~

參考資料:
http://www.cyberciti.biz/faq/linux-rhel-fedora-cen...orecond-will-not-restoreafile/





TOP

ARTERY.cn