/etc/cron.d/awstats: wrong user for cron job
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
awstats (Debian) |
New
|
Unknown
|
|||
awstats (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
/etc/cron.d/awstats runs the statistics generation cron job with user "www-data". The cron job needs to access /var/log/
$ ls -al /var/log/
-rw-r----- 1 root adm 342337 Nov 18 21:36 /var/log/
$ sudo -u www-data cat /var/log/
cat: /var/log/
That is, www-data does not have the permission to access the log file. Therefore, the user in /etc/cron.d/awstats needs to be "root" or -- probably better -- the log files of apache have to be written with permission to be read by www-data. The current default configuration -- also tested with the development version of Ubuntu 14.04 -- does not work.
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: awstats (not installed)
ProcVersionSign
Uname: Linux 3.11.0-13-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: amd64
Date: Mon Nov 18 21:35:19 2013
InstallationDate: Installed on 2013-10-18 (31 days ago)
InstallationMedia: Ubuntu-Server 13.10 "Saucy Salamander" - Release amd64 (20131016)
MarkForUpload: True
SourcePackage: awstats
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in awstats (Debian): | |
status: | Unknown → New |
Changed in awstats (Ubuntu): | |
status: | Confirmed → Triaged |
I can confirm this problem and wonder if there is any 'real' solution ?
After upgrading to 13.10 there was no problem, until log rotate.
Previous files had 644 for root:adm, now 640 for root:adm
The cron-job for awstats runs as www-data as mention above.
This cause error message when job runs: awstats. conf awstats. conf" by AWStats version 7.1.1 (build 1.989) apache2/ access. log"... apache2/ access. log" : Permission denied awstats/ awstats. conf' file, web server or permissions) may be wrong.
Error while processing /etc/awstats/
Create/Update database for config "/etc/awstats/
From data in log file "/var/log/
Error: Couldn't open server log file "/var/log/
Setup ('/etc/
Check config file, permissions and AWStats documentation (in 'docs' directory).
$ cat /etc/cron.d/awstats
MAILTO=root
*/10 * * * * www-data [ -x /usr/share/ awstats/ tools/update. sh ] && /usr/share/ awstats/ tools/update. sh
# Generate static reports: awstats/ tools/buildstat ic.sh ] && /usr/share/ awstats/ tools/buildstat ic.sh
10 03 * * * www-data [ -x /usr/share/