Spamassassin won't start

Discussion in 'Server Operation' started by countrydj, Apr 9, 2010.

  1. countrydj

    countrydj New Member

    I have just updated my spamassassin from 3.0.4-1.el5.rf to 3.3.1-3.el.rf having installed all the required dependencies.
    Now when I start spamassassin I get the following message:
    Starting spamd: child process [7005] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 2588.
    [FAILED]

    I look at /usr/bin/spamd line 2588 and it is:
    die sprintf("child process [%s] exited or timed out ".
    "without signaling production of a PID file: %s",
    $pid, exit_status_str($child_stat,0)) unless $serverstarted;
    exit;

    I have no idea what to do now.
    Can anybody help ???
     
  2. falko

    falko Super Moderator Howtoforge Staff

    As far as I understand, no PID file was created. Can you post the contents of the SpamAssassin init script?
     
  3. countrydj

    countrydj New Member

    Hi Falko...
    Many thanks for taking the time to reply to me.
    Here is my /etc/init.d/spamassassin file:

    #!/bin/sh
    #
    # spamassassin This script starts and stops the spamd daemon
    #
    # chkconfig: - 78 30
    # processname: spamd
    # description: spamd is a daemon process which uses SpamAssassin to check \
    # email messages for SPAM. It is normally called by spamc \
    # from a MDA.

    # Source function library.
    . /etc/rc.d/init.d/functions

    prog="spamd"

    # Source networking configuration.
    . /etc/sysconfig/network

    # Check that networking is up.
    [ ${NETWORKING} = "no" ] && exit 0

    # Set default spamd configuration.
    SPAMDOPTIONS="-d -c -m5 -H"
    SPAMD_PID=/var/run/spamd.pid

    # Source spamd configuration.
    if [ -f /etc/sysconfig/spamassassin ] ; then
    . /etc/sysconfig/spamassassin
    fi

    [ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
    PATH=$PATH:/usr/bin:/usr/local/bin

    # By default it's all good
    RETVAL=0

    # See how we were called.
    case "$1" in
    start)
    # tell portreserve to release the port
    [ -x /sbin/portrelease ] && /sbin/portrelease spamd &>/dev/null || :
    # Start daemon.
    echo -n $"Starting $prog: "
    daemon $NICELEVEL spamd $SPAMDOPTIONS -r $SPAMD_PID
    RETVAL=$?
    echo
    if [ $RETVAL = 0 ]; then
    touch /var/lock/subsys/spamd
    fi
    ;;
    stop)
    # Stop daemons.
    echo -n $"Stopping $prog: "
    killproc spamd
    RETVAL=$?
    echo
    if [ $RETVAL = 0 ]; then
    rm -f /var/lock/subsys/spamd
    rm -f $SPAMD_PID
    fi
    ;;
    restart)
    $0 stop
    sleep 3
    $0 start
    ;;
    condrestart)
    [ -e /var/lock/subsys/spamd ] && $0 restart
    ;;
    status)
    status spamd
    RETVAL=$?
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status|condrestart}"
    RETVAL=1
    ;;
    esac

    exit $RETVAL

    I have noticed on line 24: SPAMD_PID=/var/run/spamd.pid

    that this does not exist.
    Maybe this is the problem but I don't know how to fix it.
    Any help will be appreciated.

    Thanks,

    John C
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /var/run/
    ? Is SELinux disabled?
     
  5. countrydj

    countrydj New Member

    This is the output of /var/run

    [root@redvelvet ~]# la /var/run
    total 332
    drwxr-xr-x 24 root root 4096 Apr 12 19:01 .
    drwxr-xr-x 24 root root 4096 Mar 22 19:22 ..
    srw-rw-rw- 1 root root 0 Apr 12 11:01 acpid.socket
    -rw-r--r-- 1 root root 5 Dec 21 15:51 atd.pid
    srw-r----- 1 root root 0 Apr 12 11:01 audispd_events
    -rw-r--r-- 1 root root 6 Apr 12 11:01 auditd.pid
    prw------- 1 root root 0 Apr 12 11:01 autofs.fifo-misc
    prw------- 1 root root 0 Apr 12 11:01 autofs.fifo-net
    drwxr-xr-x 2 avahi avahi 4096 Apr 12 11:01 avahi-daemon
    drwxr-xr-x 2 root root 4096 Mar 11 17:24 console
    -rw-r--r-- 1 root root 5 Apr 9 13:24 crond.pid
    drwxr-xr-x 3 root lp 4096 Dec 21 15:51 cups
    -rw-r--r-- 1 root root 5 Dec 21 15:51 cupsd.pid
    drwxr-xr-x 2 root root 4096 Dec 21 15:51 dbus
    -rw-r--r-- 1 root root 5 Dec 21 16:08 dhclient-:1.pid
    drwxr-xr-x 3 root dovecot 4096 Dec 21 15:51 dovecot
    -rw-r--r-- 1 root root 5 Dec 21 15:51 gpm.pid
    -rw-r--r-- 1 root root 5 Dec 21 15:51 haldaemon.pid
    -rw-r--r-- 1 root root 5 Apr 11 04:03 httpd.pid
    -rw------- 1 root root 5 Dec 21 15:51 klogd.pid
    drwxr-xr-x 4 root root 4096 Apr 8 19:42 libvirt
    drwx------ 2 root root 4096 May 24 2008 mdadm
    drwx------ 2 root root 4096 May 24 2008 mdmpd
    -rw-r--r-- 1 root root 5 Dec 21 15:51 messagebus.pid
    drwxr-xr-x 2 mysql mysql 4096 Apr 9 13:24 mysqld
    drwxrwx--- 2 named named 4096 Jul 30 2009 named
    lrwxrwxrwx 1 root root 41 Apr 9 13:24 named.pid -> /var/named/chroot/var/run/named/named.pid
    drwxrwxr-x 2 root root 4096 Mar 5 2009 netreport
    drwxr-xr-x 2 root root 4096 Apr 8 2009 NetworkManager
    drwxr-x--- 2 news news 4096 Feb 26 2009 news
    drwxr-xr-x 2 root root 4096 Jan 20 18:34 nscd
    srwxrwxrwx 1 root root 0 Dec 21 15:51 pcscd.comm
    -rw-r--r-- 1 root root 4 Dec 21 15:51 pcscd.pid
    -rw-r--r-- 1 root root 65537 Dec 21 15:51 pcscd.pub
    drwxr-xr-x 2 root root 4096 Jan 22 2009 pm
    drwxr-xr-x 2 root root 4096 Jan 21 2009 ppp
    -rw-r--r-- 1 rpcuser rpcuser 5 Dec 21 15:51 rpc.statd.pid
    drwxr-xr-x 2 root root 4096 Mar 17 13:14 saslauthd
    srw-rw-rw- 1 root root 0 Dec 21 15:51 sdp
    -rw------- 1 root smmsp 32 Apr 9 13:25 sendmail.pid
    drwxr-xr-x 2 root root 4096 Jan 21 2009 setrans
    -rw-r--r-- 1 smmsp smmsp 49 Apr 9 13:24 sm-client.pid
    drwxr-xr-x 2 root root 4096 Mar 22 22:32 spamassassin
    -rw-r--r-- 1 root root 6 Apr 8 19:38 sshd.pid
    drwx------ 3 root root 4096 Mar 24 2009 sudo
    -rw------- 1 root root 5 Dec 21 15:51 syslogd.pid
    -rw-rw-r-- 1 root utmp 5376 Apr 12 19:23 utmp
    drwxr-xr-x 2 root root 4096 Jul 14 2009 winbindd
    drwxr-xr-x 2 root root 4096 Jan 21 2009 wpa_supplicant
    -rw-r--r-- 1 root root 6 Dec 21 15:51 xfs.pid
    -rw-r--r-- 1 root root 5 Apr 9 13:24 xinetd.pid
    [root@redvelvet ~]#

    I notice that there is no spand.pid. I think this should be created automatically with service spamassassin start

    SELinux IS disabled
    I couldn't get anything to run with it enabled.


    hope this helps.

    John C
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Hm, the permissions look ok. Can you run
    Code:
    spamd
    on the command line? Do you get any errors?
     
  7. countrydj

    countrydj New Member

    [root@redvelvet ~]# spamd -D
    Apr 13 17:55:02.412 [19839] dbg: logger: adding facilities: all
    Apr 13 17:55:02.413 [19839] dbg: logger: logging level is DBG
    Apr 13 17:55:02.435 [19839] dbg: logger: calling setlogsock(unix)
    Apr 13 17:55:02.436 [19839] dbg: logger: opening syslog with unix socket
    Apr 13 17:55:02.437 [19839] dbg: logger: successfully connected to syslog/unix
    Apr 13 17:55:02.437 [19839] dbg: logger: successfully added syslog method
    Apr 13 17:55:02.439 [19839] dbg: spamd: will perform setuids? 1
    Apr 13 17:55:02.441 [19839] dbg: spamd: creating INET socket:
    Apr 13 17:55:02.442 [19839] dbg: spamd: [...] Listen: 128
    Apr 13 17:55:02.443 [19839] dbg: spamd: [...] LocalAddr: 127.0.0.1
    Apr 13 17:55:02.444 [19839] dbg: spamd: [...] LocalPort: 783
    Apr 13 17:55:02.445 [19839] dbg: spamd: [...] Proto: 6
    Apr 13 17:55:02.446 [19839] dbg: spamd: [...] ReuseAddr: 1
    Apr 13 17:55:02.447 [19839] dbg: spamd: [...] Type: 1
    Apr 13 17:55:02.450 [19839] dbg: logger: adding facilities: all
    Apr 13 17:55:02.452 [19839] dbg: logger: logging level is DBG
    Apr 13 17:55:02.453 [19839] dbg: generic: SpamAssassin version 3.3.1
    Apr 13 17:55:02.454 [19839] dbg: generic: Perl 5.008008, PREFIX=/usr, DEF_RULES_DIR=/usr/share/spamassassin, LOCAL_RULES_DIR=/etc/mail/spamassassin, LOCAL_STATE_DIR=/var/lib/spamassassin
    Apr 13 17:55:02.455 [19839] dbg: config: timing enabled
    Apr 13 17:55:02.458 [19839] dbg: config: score set 0 chosen.
    Apr 13 17:55:02.477 [19839] dbg: dns: is Net::DNS::Resolver available? yes
    Apr 13 17:55:02.478 [19839] dbg: dns: Net::DNS version: 0.59
    Apr 13 17:55:02.483 [19839] dbg: spamd: Preloading modules with HOME=/tmp/spamd-19839-init
    Apr 13 17:55:02.486 [19839] dbg: config: using "/etc/mail/spamassassin" for site rules pre files
    Apr 13 17:55:02.488 [19839] dbg: config: read file /etc/mail/spamassassin/init.pre
    Apr 13 17:55:02.490 [19839] dbg: config: read file /etc/mail/spamassassin/v310.pre
    Apr 13 17:55:02.491 [19839] dbg: config: read file /etc/mail/spamassassin/v312.pre
    Apr 13 17:55:02.493 [19839] dbg: config: read file /etc/mail/spamassassin/v320.pre
    Apr 13 17:55:02.494 [19839] dbg: config: read file /etc/mail/spamassassin/v330.pre
    Apr 13 17:55:02.496 [19839] dbg: config: using "/usr/share/spamassassin" for sys rules pre files
    Apr 13 17:55:02.497 [19839] dbg: config: using "/usr/share/spamassassin" for default rules dir
    Apr 13 17:55:02.499 [19839] error: config: no rules were found! Do you need to run 'sa-update'?
    config: no rules were found! Do you need to run 'sa-update'?
    [root@redvelvet ~]# sa-update
    channel: no 'mirrors.updates.spamassassin.org' record found, channel failed
    [root@redvelvet ~]#

    My /etc/resolve file is:

    search gvl99.co.uk
    #nameserver 88.97.199.147
    nameserver 88.97.199.148
    nameserver 88.97.199.149
    nameserver 212.23.6.100
    nameserver 212.23.3.100

    These are all genuine name servers.

    hth
     
    Last edited: Apr 13, 2010
  8. JustPassingBy

    JustPassingBy New Member

    I don't know how your linux installs, but do you have a file called "MIRRORED.BY" in a location similar to (probably)/var/(maybe)db/spamassassin/[version_number_like_3.002005]/updates_spamassassin_org/

    And if so - what's in it?

    Code:
    root@tobermory# cat /var/db/spamassassin/3.002005/updates_spamassassin_org/MIRRORED.BY
    # test mirror: zone, cached via Coral
    #http://buildbot.spamassassin.org.nyud.net:8090/updatestage/
    http://spamassassin.kluge.net/updates/ weight=5
    http://daryl.dostech.ca/sa-update/asf/ weight=5
    http://www.sa-update.pccc.com/ weight=1
     
  9. countrydj

    countrydj New Member

    Hi JustPassingBy...
    Thanks for coming in on this thread. I must admit I'm absolutely lost with this problem

    I only have one MIRRORED.BY file and it is located:
    /root/.cpan/sources/MIRRORED.BY

    It doesn't contain anything at all to do with spamassassin.

    I hope that you can come up with some other suggestions that may help me.

    I am running CENTOS 5

    John C
     
    Last edited: May 3, 2010
  10. JustPassingBy

    JustPassingBy New Member

    I had the same problem as you, but when I ran sa-update it fixed it. I think sa-updates creates that file, so if it's not doing so then perhaps it could use a helping hand?

    Have a look in /var/lib and see if there's a spamassassin dir in there. If there is, create a subdir called "3.003001" and in there create a file called "updates_spamassassin_org.cf" and make it like so:

    Code:
    root@tobermory# cat updates_spamassassin_org.cf
    # UPDATE version 932302
    include updates_spamassassin_org/10_default_prefs.cf
    include updates_spamassassin_org/20_advance_fee.cf
    include updates_spamassassin_org/20_aux_tlds.cf
    include updates_spamassassin_org/20_body_tests.cf
    include updates_spamassassin_org/20_compensate.cf
    include updates_spamassassin_org/20_dnsbl_tests.cf
    include updates_spamassassin_org/20_drugs.cf
    include updates_spamassassin_org/20_dynrdns.cf
    include updates_spamassassin_org/20_fake_helo_tests.cf
    include updates_spamassassin_org/20_freemail.cf
    include updates_spamassassin_org/20_freemail_domains.cf
    include updates_spamassassin_org/20_head_tests.cf
    include updates_spamassassin_org/20_html_tests.cf
    include updates_spamassassin_org/20_imageinfo.cf
    include updates_spamassassin_org/20_meta_tests.cf
    include updates_spamassassin_org/20_net_tests.cf
    include updates_spamassassin_org/20_phrases.cf
    include updates_spamassassin_org/20_porn.cf
    include updates_spamassassin_org/20_ratware.cf
    include updates_spamassassin_org/20_uri_tests.cf
    include updates_spamassassin_org/20_vbounce.cf
    include updates_spamassassin_org/23_bayes.cf
    include updates_spamassassin_org/25_accessdb.cf
    include updates_spamassassin_org/25_antivirus.cf
    include updates_spamassassin_org/25_asn.cf
    include updates_spamassassin_org/25_dcc.cf
    include updates_spamassassin_org/25_dkim.cf
    include updates_spamassassin_org/25_hashcash.cf
    include updates_spamassassin_org/25_pyzor.cf
    include updates_spamassassin_org/25_razor2.cf
    include updates_spamassassin_org/25_replace.cf
    include updates_spamassassin_org/25_spf.cf
    include updates_spamassassin_org/25_textcat.cf
    include updates_spamassassin_org/25_uribl.cf
    include updates_spamassassin_org/30_text_de.cf
    include updates_spamassassin_org/30_text_fr.cf
    include updates_spamassassin_org/30_text_it.cf
    include updates_spamassassin_org/30_text_nl.cf
    include updates_spamassassin_org/30_text_pl.cf
    include updates_spamassassin_org/30_text_pt_br.cf
    include updates_spamassassin_org/50_scores.cf
    include updates_spamassassin_org/60_adsp_override_dkim.cf
    include updates_spamassassin_org/60_awl.cf
    include updates_spamassassin_org/60_shortcircuit.cf
    include updates_spamassassin_org/60_whitelist.cf
    include updates_spamassassin_org/60_whitelist_dkim.cf
    include updates_spamassassin_org/60_whitelist_spf.cf
    include updates_spamassassin_org/60_whitelist_subject.cf
    include updates_spamassassin_org/72_active.cf
    include updates_spamassassin_org/72_scores.cf
    include updates_spamassassin_org/local.cf
    include updates_spamassassin_org/regression_tests.cf
    In the same dir as that file, create a dir called "updates_spamassassin_org" cd into it and create the file "MIRRORED.BY" as per my previous post.

    Then run sa-update and see if it works.

    (Warning: you might want to check your sa-updates script for where it expects to find these files as I'm using a completely different UNIX to you, and the dirs in this post are the default linux ones)

    If that doesn't work then I'm afraid you could be lost in PERL hell. I despise the PERL way of doing things, I will state for the record right now. What you may have to do is reinstall perl5.whatever and then reinstall every little p5- module that SA requires. Then you can go ahead and reinstall SA.

    I suspect it's the LWP::UserAgent module that's hurting you. If you can find a replacement module for it like LWP::UserAgent::Determined then I would recommend it - it does the same thing, only when it fails to connect first time it waits and tries again a few times. It worked for me.

    PERL has a nasty trick (at least on the OS I use) of installing all its modules on a per-version basis, so if you installed perl5-8-9 or whatever then updated to perl5-10-1, not one of your single p5- modules will work until you reinstall them for the new PERL version. And when you try and update them, it complains that they are already installed and fails. It drives me to distraction.

    Good luck and let us know how you get on.
     
    Last edited: May 3, 2010
  11. countrydj

    countrydj New Member

    Hi Justpassingby...
    Sorry for being so long to respond.
    I created the directories and files that you suggested.
    I then ran sa-update.
    This time, it thought about it for a while and then returned:
    channel: no 'mirrors.updates.spamassassin.org' record found, channel failed
    The thing that is most frustrating is that I had spamassassin-3.0.4-1.1.el3 working fine.
    I then upgraded to Centos 5 so I installed spamassassin-3.3.1-2.el5.
    This sort of worked but I had all sorts of problems with it.
    So I upgraded to spamassassin-3.3.1-3.el5.rf but it refused to start.

    I can't be bothered uninstalling and re-installing perl at the moment. I may try later.

    Thank you very much for the trouble that you've gone to to try and help.
    If you do have any other ideas I am willing to try.

    Thanks,

    John C
     
  12. JustPassingBy

    JustPassingBy New Member

  13. rytec

    rytec New Member

    Hi Falko,

    I have used your manual to install Ubuntu server but after 2 days searching on the web and trying a lot of things I still can't figure out why sa-update doesn't work.
    it still says :
    root@localhost:~# sa-update --nogpg
    channel: no 'mirrors.updates.spamassassin.org' record found, channel failed

    And I also use the Google nameservers 8.8.8.8 and 8.8.4.4 because this was a suggestion on another board.

    thanks for guiding me here.
     
  14. rytec

    rytec New Member

    I have started up my old Ubuntu server with 8.04 LTS and this one has Spamassassin 3.2.5 and here the sa-updates works fine, so it can't be an internet problem.
    The Spamassassin version on my Ubuntu Lucid 10.04 LTS is 3.3.1

    I also found somewhere an issue with IPv6 problems, what can I do to disable IPv6 on eth0 ?
     
  15. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/resolv.conf?
    Does
    Code:
    ping -c4 google.com
    work?
     
  16. rytec

    rytec New Member

    Yes :

    root@localhost:~# ping -c4 google.com
    PING google.com (173.194.37.104) 56(84) bytes of data.
    64 bytes from lhr14s02-in-f104.1e100.net (173.194.37.104): icmp_seq=1 ttl=58 time=22.0 ms
    64 bytes from lhr14s02-in-f104.1e100.net (173.194.37.104): icmp_seq=2 ttl=58 time=22.8 ms
    64 bytes from lhr14s02-in-f104.1e100.net (173.194.37.104): icmp_seq=3 ttl=58 time=21.4 ms
    64 bytes from lhr14s02-in-f104.1e100.net (173.194.37.104): icmp_seq=4 ttl=58 time=24.0 ms

    /etc/resolv.conf :
    search rytec.be
    #search ANOTHER.NETWORK
    #nameserver 127.0.0.1 #Localhost if running a nameserver such as bind
    #Google nameservers
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    #EDPnet nameservers
    nameserver 217.71.8.10
    nameserver 217.71.0.33
     
  17. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. Can you try
    Code:
    sa-update --no-gpg
    again? Maybe it was just a temporary problem.
     
  18. rytec

    rytec New Member

    Nope, doesn't work, also I can see in my firewall that this server tries all nameservers so this means somehow he can't find the url for this.

    Because when a normal ping or webpage lookup is done only the first nameserver is used.

    ~# sa-update --no-gpg
    channel: no 'mirrors.updates.spamassassin.org' record found, channel failed
     
  19. falko

    falko Super Moderator Howtoforge Staff

    Code:
    server1:~# dig mirrors.updates.spamassassin.org
    
    ; <<>> DiG 9.6-ESV-R1 <<>> mirrors.updates.spamassassin.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36883
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;mirrors.updates.spamassassin.org. IN   A
    
    ;; AUTHORITY SECTION:
    spamassassin.org.       3600    IN      SOA     ns.hyperreal.org. pmc.spamassassin.apache.org. 2011010700 86400 3600 2678400 3600
    
    ;; Query time: 128 msec
    ;; SERVER: 145.253.2.75#53(145.253.2.75)
    ;; WHEN: Fri Jan  7 16:31:49 2011
    ;; MSG SIZE  rcvd: 123
    
    server1:~#
    mirrors.updates.spamassassin.org doesn't exist, but on my servers, sa-update runs successfully.
     
  20. rytec

    rytec New Member

    Which version of Spamassassin do you use there? maybe there is an error in their 3.3.1 version which I run now?

    I did same command as you :

    ~# dig mirrors.updates.spamassassin.org

    ; <<>> DiG 9.7.0-P1 <<>> mirrors.updates.spamassassin.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3536
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;mirrors.updates.spamassassin.org. IN A

    ;; AUTHORITY SECTION:
    spamassassin.org. 1800 IN SOA ns.hyperreal.org. pmc.spamassassin.apache.org. 2011010700 86400 3600 2678400 3600

    ;; Query time: 230 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Fri Jan 7 16:23:23 2011
    ;; MSG SIZE rcvd: 123
     
    Last edited: Jan 7, 2011

Share This Page