No silent failing in official scripts

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,821
Location
Switzerland
I've recently had the awstats_process.sh script fail silently because of a missing Perl module and I think this shouldn't happen. It was "difficult" to detect because even running the script from the shell didn't fail. It's only when you run individual commands that you can see what happens.

So, my suggestion is: if it comes with DA and it fails, the errors should be logged in the DA log files.
 
Hello,

It... should be.. eg: code snip
Code:
....
       /usr/bin/perl ${AWSTATS}/tools/awstats_buildstaticpages.pl -config=${DOMAIN} -configdir=${DATA_DIR} -update -diricons=icon -awstatsprog=${AWSTATS}/cgi-bin/awstats.pl -dir=${STATS_DIR} $BD
        RET=$?

...

exit $RET;
where any errors from perl should be returning a non-zero result.

And then in the DA code, if a non-zero result is returned, it would add something like this to the /var/log/directadmin/errortaskq.log:
Code:
"Unable to run awstats for (%s.)%s: %s", subdomain?subdomain:"", domain, errormessage
... so.. if we're not getting any output, my guess is perl is not reporting an error.

Let me know if I'm missing something.

John
 
Hello John,

It may not be enough then. What I found was that some errors ended up being printed in the generated HTML files, while others appear nowhere (Database is not generated).

One test you can do is to enable a plugin like ipv6 without installing the perl modules and see if awstats_process.sh complains about any error.

In my case, the error was only visible when running:
Code:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -config=domain.com -update -configdir=/home/user/domains/domain.com/awstats/.data

I guess it will be a problem if Perl itself is not properly reporting the error back to the script...
 
Back
Top