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..
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
Try to execute dspam_logrotate line into a console, replacing ${DSPAM_SPOOLDIR} with /var/spool/dspam.
------------- 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..?)
Obviously to work. Do you have the /var/spool/dspam directory? What USE flags do you have? (equery uses dspam)
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
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 ...
closed as WORKSFORME.