字體:  

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

apple 發表於: 2012-1-12 12:30 來源: ADJ網路控股集團


如果在 /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權限依序執行下列步驟即可:

QUOTE:


(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/