freshclam-can’t open /../../freshclam.log in append mod(check permission)

來源:互聯網
上載者:User

標籤: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)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.