練功房推薦書單

  • 猛虎出柙雙劍合璧版--最新 OCA / OCP Java SE 7 Programmer 專業認證 (電子書)
  • 流浪教師存零股存到3000萬(全新增修版)(書+DVD)
  • 開始在關西自助旅行(京都‧大阪‧神戶‧奈良)(全新增訂版)
  • 不敗教主的300張股票存股術

解決restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) 錯誤 RSS feed
討論區首頁 » Linux
發表人 內容
andowson

七段學員
[Avatar]

註冊時間: 2007/1/2
文章: 711
來自: 台北
離線
最近發現一台RHEL 5.1伺服器的/var/log/message出現這樣的錯誤訊息:
Nov 21 14:19:01 localhost restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
Nov 21 16:21:51 localhost restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
Nov 22 09:39:47 localhost restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
Nov 22 09:40:39 localhost restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) Invalid argument

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

輸出大致如下:
/etc/sysconfig/networking/profiles/default/resolv.conf

/etc/resolv.conf

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

rm /etc/sysconfig/networking/profiles/default/resolv.conf
restorecon /etc/resolv.conf
ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf

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

分享經驗 累積智慧
[WWW]
 
討論區首頁 » Linux
前往:   
行動版