[Pkg-awstats-devel] Trying to get /usr/share/awstats/tools/update.sh working for multiple sites

Ken Neighbors KenNeighbors at gmail.com
Mon Apr 26 20:20:40 UTC 2010


First off let me ask: should I email bug reports and feature requests 
relating to the experimental awstats package to this address or submit 
them to the Debian bug tracking system?  I recently submitted a 
follow-up comment to an existing bug report 
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572353), but realized 
afterwards that I was referring to features in the experimental version 
of the package (which I probably should have noted in my report).  Also, 
I am preparing additional comments, suggestions, and patches and would 
like to know where to send them.

Anyway, this current email is about the new update.sh script which is 
called from cron.  I cannot get it to work for multiple sites as 
described in README.Debian.  It always fails (without emitting an error 
message) when it finds that SiteDomain is not defined in 
/etc/awstats/awstats.conf nor awstats.conf.local (note that I removed 
the ">/dev/null" at the end of update.sh in order to see this error 
message):

Error: SiteDomain parameter not defined in your config/domain file. You 
must edit it for using this version of AWStats.
Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may 
be wrong.
Check config file, permissions and AWStats documentation (in 'docs' 
directory).

root:/etc/awstats# ls -l
total 72
-rw-r--r-- 1 root root 61054 2010-04-26 11:16 awstats.conf
-rw-r--r-- 1 root root   240 2010-04-26 11:39 awstats.conf.local
-rw-r--r-- 1 root root   618 2010-04-26 11:08 awstats.example.com.conf

My SiteDomain is defined in awstats.example.com.conf as described in 
README.Debian.  However, update.sh first tries to run awstats.pl on the 
default config file (awstats.conf).  It fails and then exits before 
trying it on any other config files (because of "set -e" in the script).

I have been studying this problem and thinking about it all day and 
cannot find a way to have the update script be able to work with both 
the default awstats.conf and with other custom config files unless you 
get rid of "set -e" or unless you put the default "awstast" last in the 
list instead of first, e.g.:

for c in `/bin/ls -1 awstats.*.conf 2>/dev/null | \
           /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'` awstats
do

However, I am working on a patch I want to submit that will allow this 
script to report errors found in the config files (instead of remaining 
completely silent with ">/dev/null") because it is difficult for a 
sysadmin to track down problems with awstats when cron does not report 
the error.

So my suggestion (as further described in my follow-up to 572353) is 
that update.sh should not call awstats with the default config file 
/etc/awstats/awstats.conf.  Instead, update README.Debian to instruct 
the sysadmin that they should install either a single site-specific 
config file (perhaps called "awstats.default.conf") or install multiple 
site-specific config files (as currently described in the README).

I am willing to help with the documentation and patches to the scripts, 
but wanted to submit this for your consideration to help me decide which 
way to proceed.

Ken



More information about the Pkg-awstats-devel mailing list