AWStats 錯誤:管道指令失敗

AWStats 錯誤:管道指令失敗

當透過管道讀取 Icecast 日誌以過濾掉一個虛擬主機時,我從 AWStats 7.2 cron 作業(在 Ubuntu 14.04 上,使用 Stock awstats 軟體包)收到此錯誤:

Error while processing /etc/awstats/awstats.mysite.conf
Create/Update database for config "/etc/awstats/awstats.mysite.conf" by AWStats version 7.2 (build 1.992)
From data in log file "grep '\/mysite' < /var/log/icecast2/access.log |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Error: Command for pipe 'grep '\/mysite' < /var/log/icecast2/access.log |' failed
Setup ('/etc/awstats/awstats.mysite.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

www-data從表面上看,這看起來像是一個簡單的權限問題,但設定檔和日誌檔案都可以被運行的使用者讀取。如果我進入該使用者帳戶,我可以毫無問題地讀取這兩個檔案。

#sudo -u www-data ls -al /etc/awstats/awstats.mysite.conf /var/log/icecast2/access.log
-rw-r--r-- 1 www-data www-data 444 May 13 11:23 /etc/awstats/awstats.mysite.conf
-rw-r--r-- 1 icecast2 icecast    0 Jun  8 05:29 /var/log/icecast2/access.log

如果我在同一用戶下執行 grep 命令,也可以正常工作。

為了避免虛假問題,我禁用了所有插件 - 無論如何我只使用 geoip,所以設定非常普通。如果我手動運行 awstats 命令並提供完整--debug=6輸出,看起來讀取文件沒有任何問題 - 文件關閉時會引發錯誤。碰巧的是,該日誌檔案目前為空,因此沒有什麼可分析的,但這肯定不會產生權限錯誤嗎?

Sat Jun 13 20:33:21 2015 - DEBUG 1 - Start Update process (lastprocesseddate=201505)
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Open log file "grep '\/mysite' < /var/log/icecast2/access.log |"
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _host_p:0 _host_h:0 _host_k:0 _host_l:0 _host_s:0 _host_u:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _url_p:0 _url_k:0 _url_e:0 _url_x:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _waithost_e:0 _waithost_l:0 _waithost_s:0 _waithost_u:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 - End of processing log file (AWStats memory cache is TmpDNSLookup=0 TmpBrowser=0 TmpOS=0 T
mpRefererServer=0 TmpRobot=0)
....(lots of stuff that seems related to successful processing and output deleted)
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update offset of section sider_404=10022 in file at offset 1381
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthVisits=290 in file at offset 2140
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthUnique=168 in file at offset 2173
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthHostsKnown=0 in file at offset 2210
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthHostsUnknown=182 in file at offset 2249
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Call to Init_HashArray
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Close log file "grep '\/mysite' < /var/log/icecast2/access.log |"
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Command for pipe 'grep '\/mysite' < /var/log/icecast2/access.log |' failed

我錯過了什麼?

相關內容