Fail to test amavisd-new

Discussion in 'Server Operation' started by satimis, May 24, 2007.

  1. satimis

    satimis Member

    Hi folks,


    OpenBSD 4.0
    amavisd-new-2.5.0

    Failed to test amavisd-new

    # /usr/local/sbin/amavisd -u _clamav debug
    Code:
     
    ....
    .....
    /var/amavis/db/; BerkeleyDB 0.31, libdb 4.5
    May 18 12:58:42 mail.satimis.com /usr/local/sbin/amavisd[3702]: 
    (!!)TROUBLE in pre_loop_hook: QUARANTINEDIR directory not writable:    
    
    /var/virusmails at /usr/local/sbin/amavisd line 7802.
    Suicide () TROUBLE in pre_loop_hook: QUARANTINEDIR directory not 
    writable: /var/virusmails at /usr/local/sbin/amavisd line 7802.
    
    cat /etc/amavisd.conf
    Code:
    ......
    $max_servers = 2;            # num of pre-forked children (2..15 is 
    common), -m
    $daemon_user  = '_clamav';     # (no default;  customary: vscan or 
    amavis), -u
    $daemon_group = '_clamav';     # (no default;  customary: vscan or 
    amavis), -g
    
    $mydomain = 'satimis.com';   # a convenient default for other settings
    
    $MYHOME = '/var/amavis';   # a convenient default for other settings, 
    -H
    $TEMPBASE = "$MYHOME/tmp";   # working directory, needs to exist, -T
    $ENV{TMPDIR} = $TEMPBASE;    # environment variable TMPDIR
    $QUARANTINEDIR = '/var/virusmails';  # -Q
    # $quarantine_subdir_levels = 1;  # add level of subdirs to disperse 
    quarantine
    
    # $daemon_chroot_dir = $MYHOME;   # chroot directory or undef, -R
    
    $db_home   = "$MYHOME/db";      # dir for bdb nanny/cache/snmp 
    databases, -D
    $helpers_home = "$MYHOME/var";  # working directory for SpamAssassin, 
    -S
    $lock_file = "$MYHOME/var/amavisd.lock";  # -L
    $pid_file  = "$MYHOME/var/amavisd.pid";   # -P
    ......
    
    Pls advise how to fix it. TIA


    B.R.
    satimis
     
  2. falko

    falko Super Moderator Howtoforge Staff

    It seems that /var/virusmails has wrong permissions. Please post the output of
    Code:
    ls -la /var
     
  3. satimis

    satimis Member

    Hi falko,

    # ls -l /var/ | grep virusmails
    Code:
    drwxr-xr-x   2  750      _clamav   512 May    7 18:15 virusmails
    
    Having performed following steps to get the problem solved.

    # chown -R _clamav:_clamav /var/virusmails
    No printout


    # /usr/local/sbin/amavisd -u _clamav debug
    Code:
    ......
    .......
    May 25 09:00:59 mail.satimis.com /usr/local/sbin/amavisd[14949]: May 25
    09:00:59 mail.satimis.com /usr/local/sbin/amavisd[169]: Net::Server:
    Child Preforked (14949)Net::Server: Parent ready for children.
    
    May 25 09:00:59 mail.satimis.com /usr/local/sbin/amavisd[14949]: TIMING
    [total 6 ms] - bdb-open: 6 (100%)100, rundown: 0 (0%)100
    
    
    Stopped here


    ^C to exit;
    Code:
    ^CMay 25 09:05:51 mail.satimis.com /usr/local/sbin/amavisd[169]:
    Net::Server: 2007/05/25-09:05:51 Server closing!
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[17456]:
    child_finish_hook: invoking DESTROY methods
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[17456]:
    Amavis::Cache DESTROY called
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[17456]:
    Amavis::DB::SNMP DESTROY called
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[14949]:
    child_finish_hook: invoking DESTROY methods
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[14949]:
    Amavis::Cache DESTROY called
    May 25 09:05:52 mail.satimis.com /usr/local/sbin/amavisd[14949]:
    Amavis::DB::SNMP DESTROY called
    
    No complaint found.


    # /usr/local/sbin/amavisd -u _clamav start
    No printout.


    Now I'm trying figuring out how to run both clamav and amavisd-new as _clamav

    Any advice? TIA


    B.R.
    satimis
     
  4. falko

    falko Super Moderator Howtoforge Staff

    I'm not sure, but can't you set the user in the amavisd configuration?
     
  5. satimis

    satimis Member

    Hi falko,


    Performed following steps:

    # chown -R _clamav:_clamav /var/db/clamav/

    On /etc/clamd.conf added
    Code:
    ......
    # Run as another user (clamd must be started by root to make this option
    # working).
    # Default: don't drop privileges
    #User clamav
    User _clamav 
    
    # /usr/local/sbin/clamd restart
    Code:
    Running as user _clamav (UID 539, GID 539)
    ERROR: Can't open /var/log/clamd.log in append mode (check permissions!).
    ERROR: Problem with internal logger. Please check the permissions on the
    /var/log/clamd.log file.
    
    Error found.

    # ls -l /var/log | grep clamd.log
    # find / -name clamd.log
    both w/o printout

    I can either create "clamd.log" or to comment out:
    Code:
    #LogFile /var/log/clamd.log
    
    The problem is, the file "clamd.log" will grow continuously unless running "newsyslog" or "cron" (logrotate on Linux). But I'm not experienced on both of them. Can you advise? TIA


    B.R.
    satimis
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Isn't logrotate called on a daily basis on your system?
     
  7. satimis

    satimis Member

    No.

    OpenBSD uses "newsyslog" instead. I heard "cron" before. It is more powerful. Neither I have experience on both of them.


    satimis
     

Share This Page