'DirData' parameter does not exist or ...

Cowsrus
2011-02-25
2012-10-11
  • Cowsrus
    Cowsrus
    2011-02-25

    Error: AWStats database directory defined in config file by 'DirData'
    parameter (/home/user/www/awstats) does not exist or is not writable

    This error is generated only when the awstats command is run from cron.
    When run as root from the command line, the files in DirData are updated. The
    cron job is running as root:

    31 * * root run-parts /etc/cron.hourly

    -rwxr-xr-x. 1 root root 337 Feb 25 02:01 /etc/cron.hourly/awstats

    contains:

    !/bin/bash
    /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats"
    -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
    exit 0

    Strangely, there's a config awstats.localhost.localdomain.conf with a default
    DirData /var/lib/awstats for which the files are updated (from cron).

    The permissions of /var/lib/awstats

    drwxr-xr-x. 2 root root 4096 Feb 25 02:31 awstats

    The permissions of /home/user/www/awstats

    drwxr-xr-x. 2 root root 16384 Feb 25 02:03 awstats

    The selinux permissions of /var/lib/awstats

    drwxr-xr-x. root root system_u:object_r:awstats_var_lib_t:s0 awstats

    The selinux permissions of /home/user/www/awstats

    drwxr-xr-x. root root unconfined_u:object_r:awstats_var_lib_t:s0 awstats

    Makes no difference, the files in /var/lib/awstats are updated while the files
    in /home/user/www/awstats aren't and receive the DirData error. There's no
    selinux related errors whatsoever.

    awstats (6.95) had been working for about 2 years and since September 2010
    this has been going on.