Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 161863 - mail-filter/dspam - broken cron script
Summary: mail-filter/dspam - broken cron script
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-13 08:19 UTC by Thomas Capricelli
Modified: 2007-01-27 05:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2007-01-13 08:19:39 UTC
i got this mail from cron every day :
-------
Usage: /usr/bin/dspam_logrotate -a age [-v] -l logfiles
or
Usage: /usr/bin/dspam_logrotate -a age [-v] -d /var/dspam
-------

Reproducible: Always




Here are what i've found.
The message comes from /etc/cron.daily/dspam.cron
there are those two lines :
DSPAM_HOMEDIR="$(getent passwd dspam | awk -F : '{print $6}')"
DSPAM_SPOOLDIR="$(grep ^Home "${DSPAM_HOMEDIR}/dspam.conf" | cut -d' ' -f2)"

the first line use passwd to find the home, which is /var/spool/dspam. And there are no /var/spool/dspam/dspam.conf. The file dspam.conf is in /etc/

I dont really know what to do. Should i change the line in passwd ? the entire line looks like :
dspam:x:26:514:added by portage for dspam:/var/spool/dspam:/bin/bash

so i dont really dare..
Comment 1 Thomas Capricelli 2007-01-13 08:22:54 UTC
the file contains also :
--------
DSPAM_DATA_FILES=( "${DSPAM_HOMEDIR}"/*.data )
if [ ! -f "${DSPAM_DATA_FILES[0]}" ]
then
        DSPAM_DATA_FILES=( /etc/mail/dspam/*.data )
        if [ -f "${DSPAM_DATA_FILES[0]}" ]
        then
                DSPAM_HOMEDIR="/etc/mail/dspam"
        fi
fi
------

and i've checked, there are no /var/spool/dpspam/*.data and there are files in /etc/ail/dspam/*.data

---------
verdi dspam # ls /var/spool/dspam/*.data
ls: cannot access /var/spool/dspam/*.data: No such file or directory
verdi dspam # ls /etc/mail/dspam/*.data
/etc/mail/dspam/mysql.data
--------

so i dont understand why the scrip fails



Comment 2 Alin Năstac (RETIRED) gentoo-dev 2007-01-13 10:39:22 UTC
Try to execute dspam_logrotate line into a console, replacing ${DSPAM_SPOOLDIR} with /var/spool/dspam.
Comment 3 Thomas Capricelli 2007-01-13 11:17:40 UTC
-------------
verdi cron.daily # su -s /bin/sh -c "/usr/bin/dspam_logrotate -a 30 -d /var/spool/dspam" dspam
Usage: /usr/bin/dspam_logrotate -a age [-v] -l logfiles
or
Usage: /usr/bin/dspam_logrotate -a age [-v] -d /var/dspam
-----------

(what did you expect..?)
Comment 4 Alin Năstac (RETIRED) gentoo-dev 2007-01-13 11:38:46 UTC
Obviously to work. 

Do you have the /var/spool/dspam directory? 
What USE flags do you have? (equery uses dspam)
Comment 5 Thomas Capricelli 2007-01-13 12:43:56 UTC
yes, i have it, but with no *.data (as the dspam.cron suggests there should be)

here are some more infos :


verdi cron.daily # ls /var/spool//dspam/*
/var/spool//dspam/opt-in:

/var/spool//dspam/opt-out:

verdi cron.daily # ls /etc/dspam/
dspam.conf  mysql.data  mysql_objects-4.1.sql  mysql_objects-space.sql  mysql_objects-speed.sql  mysql_purge-4.1.sql  mysql_purge.sql  txt

verdi cron.daily # equery  uses dspam
[ Searching for packages matching dspam... ]
[ Colour Code : set unset ]
[ Legend        : Left column  (U) - USE flags from make.conf                     ]
[                  : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for mail-filter/dspam-3.6.8-r2 ]
 U I
 - - clamav        : Adds support for Clam AntiVirus software (usually with a plugin)
 - - daemon        : Enable support for DSPAM to run in --daemon mode
 - - debug         : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml .
 - - large-domain  : Builds for large domain rather than for domain scale
 - + ldap          : Adds LDAP support (Lightweight Directory Access Protocol)
 - - logrotate     : Install support files for logrotate
 + + mysql         : Adds mySQL Database support
 - - oracle        : Enable Oracle Database support
 - - postgres      : Adds support for the postgresql database
 - - sqlite        : Adds support for sqlite - embedded sql database
 - - sqlite3       : Adds support for sqlite3 - embedded sql database
 - - user-homedirs : Build with user homedir support
 - - virtual-users : Build with virtual-users support
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2007-01-13 13:03:29 UTC
You misunderstood the cron script; *.data files should be in /etc/mail/dspam. Anyway, there are no connection between *.data files and dspam_logrotate. The script only delete obsolete entries out of *.log files (yes, it search for this kind of files recursively).

I have the same USE flags and it works for me. dspam_logrotate fails to run if dspam user cannot access the current directory. Please make sure dspam user can access / dir (ls -ld /) and run the following commands:
  cd /
  su ...
Comment 7 Alin Năstac (RETIRED) gentoo-dev 2007-01-27 05:55:42 UTC
closed as WORKSFORME.