標籤:permission blank border target style
650) this.width=650;" title="QQ20150112140728" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="QQ20150112140728" src="http://s3.51cto.com/wyfs02/M01/58/98/wKioL1S1QBKjK0RcAACWC3KjSh0821.jpg" width="643" height="89" />
日誌顯示執行crond服務下面的freshclam指令碼時候出錯。freshclam.log記錄檔不能疊加,檢查許可權。
既然許可權問題,就查看下它的歸屬許可權屬於哪個使用者與組。
/etc/cron.daily/freshclam是ClamAV病毒庫定時更新指令碼。
fresclam是ClamAV病毒庫更新工具。
/etc/freshclam.conf是ClamAV病毒科更新工具的設定檔。
查看/etc/cron.daily/freshclam指令碼
650) this.width=650;" title="freshclam2" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam2" src="http://s3.51cto.com/wyfs02/M02/58/98/wKioL1S1QBPy89hwAAE-39G17xk197.jpg" width="643" height="316" />
freshclam.log使用者與組是clam,許可權644,資料庫目錄在/var/lib/clamav下。
每日執行命令:
/usr/bin/freshclam –quiet --datadir=”/var/lib/clamav” --log=”/var/log/clamav/freshclam.log
查看freshclam.log日誌目錄許可權
650) this.width=650;" title="freshclam3" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam3" src="http://s3.51cto.com/wyfs02/M00/58/98/wKioL1S1QBOSxBKtAABdlWYXLPc043.jpg" width="643" height="50" />
記錄檔屬clam使用者及組
查看設定檔/etc/freshclam.conf
650) this.width=650;" title="freshclam1" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam1" src="http://s3.51cto.com/wyfs02/M01/58/98/wKioL1S1QBXRY0TkAADlLDH4qjA611.jpg" width="640" height="163" />
DatabaseDirectory /var/clamav: freshclam更新工具的設定檔資料庫目錄為/var/clamav
DatabaseOwner clamav: 資料庫的所有者clamav
NotifyClamd /etc/clamd.conf: 當執行病毒庫更新後,會通知clamd服務重新載入病毒庫
當在命令列直接執行freshclam命令時,會按此設定檔執行命令。
資料庫的所屬使用者與組為clamav,修改/etc/cron.daily/freshclam與/var/log/clamav使用者與組
650) this.width=650;" title="freshclam4" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam4" src="http://s3.51cto.com/wyfs02/M02/58/98/wKioL1S1QBbSXo3HAAFAqeJCcmI227.jpg" width="637" height="383" />
此處也可以修改--datadir的目錄跟freshclam.conf一致,根據個人意願。
650) this.width=650;" title="freshclam5" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam5" src="http://s3.51cto.com/wyfs02/M00/58/98/wKioL1S1QBfQSxagAACDbc3Mg4c549.jpg" width="636" height="70" />
執行freshclam指令碼並查看日誌
[[email protected] ~]# sh /etc/cron.daily/freshclam
650) this.width=650;" title="freshclam6" style="border-left- 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" border="0" alt="freshclam6" src="http://s3.51cto.com/wyfs02/M01/58/98/wKioL1S1QBiQyVUdAAGlzsKC0q4076.jpg" width="637" height="204" />
更新成功。。。
freshclam-can’t open /../../freshclam.log in append mod(check permission)