Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: zmsaupdate doesn't restart amavisd

  1. #1
    babyporch is offline Active Member
    Join Date
    Jan 2009
    Location
    Palermo
    Posts
    43
    Rep Power
    6

    Default zmsaupdate doesn't restart amavisd

    I enabled zmsaupdate (very usefull).

    It update the spamassassin rules, stop amavisd, but don't start it.

    Here my zmlocalconfig output:

    Code:
    [zimbra@mail ~]$ zmlocalconfig -s | grep antispam
    antispam_backup_retention = 0
    antispam_enable_restarts = TRUE
    antispam_enable_rule_updates = TRUE
    antispam_mysql_data_directory = ${zimbra_home}/data/amavisd/mysql/data
    antispam_mysql_directory = ${zimbra_home}/mta/mysql
    antispam_mysql_enabled = false
    antispam_mysql_errlogfile = ${zimbra_home}/log/antispam-mysqld.log
    antispam_mysql_host = 127.0.0.1
    antispam_mysql_mycnf = ${zimbra_home}/conf/antispam-my.cnf
    antispam_mysql_password =
    antispam_mysql_pidfile = ${zimbra_home}/data/amavisd/mysql/mysql.pid
    antispam_mysql_port = 7308
    antispam_mysql_root_password =
    antispam_mysql_socket = ${zimbra_home}/data/amavisd/mysql/mysql.sock
    antispam_mysql_user = zimbra
    Here the code correctly injected on crontab:

    Code:
    #
    # Spam rule updates
    #
    45 0 * * * /opt/zimbra/libexec/zmsaupdate
    #
    # Dspam cleanup
    I tested in three days and after the cronjob is executed amavisd stops but rules are update.

    No errors in any log files. I also tested with TRUE value in low case but don't change.

    Any idea?

  2. #2
    JakeMS's Avatar
    JakeMS is offline Active Member
    Join Date
    Jul 2013
    Location
    /dev/urandom
    Posts
    31
    Rep Power
    1

    Default

    Hi porch,

    This is a bug in 8.0.5 as I've expirenced this myself since upgrading from 8.0.4_GA_5739.NETWORK (FOSS, but detected as network since P1) to 8.0.5_GA_5839.FOSS (Detected correctly)

    In theory, the simplest way to fix this issue would be to do the following, which I have yet to try:

    After:
    Code:
    #
    # Spam rule updates
    #
    45 0 * * * /opt/zimbra/libexec/zmsaupdate
    #
    Add:

    Code:
    #
    # Check if spam is running
    #
    55 0 * * * /opt/zimbra/bin/zmamavisdctl start
    #
    # Dspam cleanup
    If antispam stuff correctly restarted, it would just exit with:
    Code:
    Starting amavisd...amavisd is already running.
    else, if it's not running:
    Code:
    Starting amavisd...done.
    So in theory it should be relatively safe, and it runs 10 minutes after the update, so chances are, any update would be completed.

    Hope this helps! .

  3. #3
    babyporch is offline Active Member
    Join Date
    Jan 2009
    Location
    Palermo
    Posts
    43
    Rep Power
    6

    Default

    Nice solution. Testing. I'll report the results.

    Inviato dal mio Galaxy Nexus con Tapatalk 2

  4. #4
    JakeMS's Avatar
    JakeMS is offline Active Member
    Join Date
    Jul 2013
    Location
    /dev/urandom
    Posts
    31
    Rep Power
    1

    Default

    Okay.. after some testing.. does not work

    I thought it would, but sadly.. does not.

    I tried two different ways.

    1) In zimbra user crontab (one in op)
    2) In system wide crontab.

    System wide crontab ends as so:

    Code:
    Stopping amavisd...amavisd is not running.
    Starting amavisd...ERROR: MISSING REQUIRED BASIC MODULES:
      Time::HiRes
      IO::Stringy
      Unix::Syslog
      Compress::Zlib
      MIME::Words
      MIME::Head
      MIME::Body
      MIME::Entity
      MIME::Parser
      MIME::Decoder
      MIME::Decoder::Base64
      MIME::Decoder::Binary
      MIME::Decoder::QuotedPrint
      MIME::Decoder::NBit
      MIME::Decoder::UU
      MIME::Decoder::Gzip64
      Net::Server
      Net::Server::PreFork
    BEGIN failed--compilation aborted at /opt/zimbra/amavisd/sbin/amavisd line 248.
    failed.
    and zimbra user crontab ends as simply:

    Code:
    Starting amavisd...failed.
    (Used >> /tmp/log.txt to get output)

    Oddly, running the command as zimbra user manually works just fine.. so why doesn't it work? no idea.. although this is most likely why it doesn't start up again too...

    So... I've no idea where to go from here.

  5. #5
    babyporch is offline Active Member
    Join Date
    Jan 2009
    Location
    Palermo
    Posts
    43
    Rep Power
    6

    Default

    Thanks, i aborted my tests.
    Need to fill a bug?

    Inviato dal mio Galaxy Nexus con Tapatalk 2

  6. #6
    JakeMS's Avatar
    JakeMS is offline Active Member
    Join Date
    Jul 2013
    Location
    /dev/urandom
    Posts
    31
    Rep Power
    1

    Default

    Hi,

    I would suggest searching the zimbra bugtracker to see if the issue has already been reported:
    https://bugzilla.zimbra.com/

    If it has not been reported previously, I think reporting the issue would be the best choice as it's confirmed my end, and your end already so it's not an isolated incident and is clearly a bug (two different installs, etc)

    As for resolution, I would suggest setting zimbra to the following:
    Code:
    antispam_backup_retention = 0
    antispam_enable_restarts = false
    antispam_enable_rule_updates = true
    This should solve the issue of having a backlog of deferred emails. Simply run the above command with restart manually as zimbra user once a day, or perhaps reboot zimbra (service zimbra restart) once a day via cron during very slow unused hours. I already do this due to a backup so .

    I find 4AM is about our quietest time here for emails in the UK.

    But at least this way, you'll know everything is still up.

  7. #7
    babyporch is offline Active Member
    Join Date
    Jan 2009
    Location
    Palermo
    Posts
    43
    Rep Power
    6

    Default

    No bugs opened for this. Just open this new Bug 84222 ? zmsaupdate don't restart amavisd.

    For now i just use the autoupdate feature of zmsaupdate. In the morning, when i'm in office, if sa-rules are update i restart amavisd.

    Thanks for your collaboration.

  8. #8
    quanah is offline Zimbra Employee
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,196
    Rep Power
    9

    Default

    Not clear why anyone is messing with

    Code:
    antispam_backup_retention
    as it is not used by zmsaupdate at all.

    It only uses the other two keys. I'm investigating why you are seeing a failure to restart. The cron output seems to indicate an issue with amavis finding the zimbra perl modules.
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  9. #9
    quanah is offline Zimbra Employee
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,196
    Rep Power
    9

    Default

    Ok, you should be able to fix this by changing the cron line to be:

    Code:
    45 0 * * * . /opt/zimbra/.bashrc; /opt/zimbra/libexec/zmsaupdate
    So that the PERL5LIB variable is correctly set inside of cron so that amavis can pick it up.
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  10. #10
    JakeMS's Avatar
    JakeMS is offline Active Member
    Join Date
    Jul 2013
    Location
    /dev/urandom
    Posts
    31
    Rep Power
    1

    Default

    Hi quanah,

    I've not altered backup_retention, i just did a quick grep antispam and posted output :-).

    The first cron, with perl modules, was the system wide crontab (/etc/crontab) and was only attempted after the one in the user crontab (su - zimbra; crontab -l) failed with no errors being shown what-so-ever so was most likely due to it attempting to run outside the zimbra environment and was performed for the sole-purposes of seeing if it'd work that way.

    The one in the user crontab however should work, as it is within the zimbra environment however provides no indication as to why it is failing. The strange part is the fact it works just fine if run manually by a user.

    As for it not starting it's self after update, I'm not sure. There's no logs to indicate as to why it is not working.

    Hope this helps you understand the issue a little better :-).

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Enable zmsaupdate
    By babyporch in forum Administrators
    Replies: 2
    Last Post: 09-22-2013, 11:54 AM
  2. MTA stops, wont restart without full restart
    By bctechnzl in forum Administrators
    Replies: 0
    Last Post: 08-17-2010, 09:19 PM
  3. amavisd.conf in 6.0.7
    By liverpoolfcfan in forum Administrators
    Replies: 2
    Last Post: 06-28-2010, 01:14 AM
  4. Amavisd Issue
    By tenmei in forum Administrators
    Replies: 8
    Last Post: 03-17-2008, 11:08 AM
  5. Amavisd going crazy - best way to restart it?
    By Yann2 in forum Migration
    Replies: 5
    Last Post: 09-17-2007, 09:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •