Issues with amavisd-new: won't start

Discussion in 'Installation/Configuration' started by carlos1014, Oct 2, 2011.

  1. carlos1014

    carlos1014 New Member

    Hello, I am using FC15 and following the tutorial for setting up Postfix. I have run into a bit of a dilemma and I have been searching all over the place to try to find an answer. Sorry for the lengthy post, but I figured I'd tell my tale so that everyone can see where I've been; this way I won't be told to go there again.

    I installed amavisd-new and clamav as per Page 4 of the tutorial. I changed the settings in amavisd.conf as instructed (entering my correct server information, of course).

    When I entered the command to start amavisd, I was presented with the following error:
    Code:
    Starting amavisd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                               [FAILED]
    
    I noticed it did not give me a log to check. So I went to /var/log and looked at the messages log, where I got this
    Code:
    Oct  2 00:35:14 server systemd[1]: amavisd.service: control process exited, code=exited status=255
    Oct  2 00:35:14 server systemd[1]: Unit amavisd.service entered failed state.
    
    I searched for the above error string, only to be sent to articles about what status 255 means and not answering my question. The Force guided me to run

    Code:
    # cd /etc/init.d
    # amavisd
    
    (note the absence of 'start')

    At first it told me that the file /etc/amavisd.conf did not exist and that the script was failing at line 1795 in /usr/bin/amavisd. So, I went to edit said script file, only to find that the variable was set by another file (or at least it appeared to be. Searching for $config_file only sent me on an endless circle with nowhere to set the file path to the conf file). So, I created a symbolic link to point to /etc/amavisd/amavisd.conf; I then ran the amavisd command above again.

    Apparently $myhostname needed to be a FQDN and did not like my machine's name, which was simply 'server.' Funny, I don't remember that being in the tutorial. I should probably add that I've followed similar tutorials for the previous versions of Fedora and never had amavisd give me this problem. Anyway, I did as requested by amavis: I uncommented the line and entered a FQDN in $myhostname and commanded Fedora to start the flippin' program:

    Code:
    # /etc/rc.d/init.d/amavisd start
    
    I about threw the screen out the window when the error message about it failing came up again, but this time the code was 102. However, I remembered my Jedi training and did not give in to the Dark Side. So, I went and looked in the messages log... No new error entry there... I looked in maillog, and behold! Amavis created the BDB in /var/spool/amavisd, and all other kinds of activities (PERL modules loading)... But wait, Fedora told me the process failed, so how is this happening?

    Code:
    # service amavisd status
    amavisd.service - SYSV: amavisd is an interface between MTA and content checkers
    	  Loaded: loaded (/etc/rc.d/init.d/amavisd)
    	  Active: failed since Sun, 02 Oct 2011 00:44:00 -0400; 8min ago
    	 Process: 32438 ExecStart=/etc/rc.d/init.d/amavisd start (code=exited, status=102)
    	  CGroup: name=systemd:/system/amavisd.service
    # cd /etc/init.d
    # amavisd
    The amavisd daemon is already running, PID: [32355]
    
    So now I am really confused! How can I have a PID (in essence, it's running) yet the process failed? To make sure SELinux wasn't giving me any issues, I set it to permissive mode, stopped amavis and started it again. I was given the same failed messages in the beginning and amavis wouldn't start...

    At this point, if I again process

    Code:
    # cd /etc/init.d
    # amavisd
    
    I get:
    Code:
    The amavisd daemon is already running, PID: [32355]
    
    :eek::eek::eek:
    So, here is where I am now... can anyone please shed some light on this. Did I miss a setting somewhere? :confused:
     
  2. falko

    falko Super Moderator ISPConfig Developer

    To which tutorial (URL) are you referring?

    Have you tried to delete the PID file manually and restart amavisd?
     
  3. carlos1014

    carlos1014 New Member

  4. Amicus

    Amicus New Member HowtoForge Supporter

    The same issue

    I have no pid file anywhere on my system and amavisd still will not start. I even nulled the amavisd.conf file and re-copied the complete contents from the howto. Still no go.
    It's not your fault Falko, but I really hate error messages that give you no clue where to look. Here they are as such:
    ===============================================
    [root@www ~]# service amavisd status
    amavisd.service - SYSV: amavisd is an interface between MTA and content checkers
    Loaded: loaded (/etc/rc.d/init.d/amavisd)
    Active: failed since Tue, 21 Feb 2012 18:44:06 -0600; 11min ago
    Process: 19117 ExecStart=/etc/rc.d/init.d/amavisd start (code=exited, status=255)
    Main PID: 2309 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/amavisd.service
    -------------------------------------------------------------
    Feb 21 18:35:34 www systemd[1]: amavisd.service: control process exited, code=exited status=255
    Feb 21 18:35:34 www systemd[1]: Unit amavisd.service entered failed state.
    Feb 21 18:44:06 www systemd[1]: amavisd.service: control process exited, code=exited status=255
    Feb 21 18:44:06 www systemd[1]: Unit amavisd.service entered failed state.
    -------------------------------------------------------------
    Feb 21 18:44:06 www amavis[19121]: starting. /usr/sbin/amavisd at www.example.com amavisd-new-2.6.6 (20110518), Unicode aware, LANG="en_US.UTF-8"
    Feb 21 18:44:06 www amavis[19121]: Perl version 5.012004
    ===============================================
    Thank in advance,
    Will
     
  5. Amicus

    Amicus New Member HowtoForge Supporter

    Further trial and error testing has indicated the following line in amavisd.conf is causing it not to start:

    @lookup_sql_dsn =
    ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'mail_admin, 'Mail_Admin_Password'] );

    When I remark it out Amavisd starts.

    I tried reinstalling the Perl DBI stuff but it didn't help. I've tested the MySQL database connection and it works. All I know now is tomorrow I'll have a lot of users mad at me. <Grin>
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Is MySQL using TCP and listening on port 3306? You can check with
    Code:
    netstat -tap
    Also make sure you use the correct MySQL login in your amavisd configuration.
     
  7. Amicus

    Amicus New Member HowtoForge Supporter

    Yes. It is using 3306.

    Could it be an issue with systemd?

    I also re-entered the login user and password after verifying they work using mysql login.
     
    Last edited: Feb 22, 2012
  8. Amicus

    Amicus New Member HowtoForge Supporter

    I had to do a force rebuild of Perl modules Bundle::Mysql to get it to work. It was some version problem with two versions of DBD::mysql on my system. It wouldn't allow mysql.so to start. Thanks anyway.
     

Share This Page