1 (edited by AshcorTech 2013-11-21 22:05:18)

Topic: Rebooted server and now postgrey won't start

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: OpenSuse
- Related log if you're reporting an issue:
====

Rebooted the server yesterday and now I noticed that I'm not getting mail.  Checked /var/log/mail and see this over and over:

###############################

2013-11-21T09:03:10.222426-05:00 linux01 postfix/smtpd[7560]: connect from unknown[198.61.169.132]
2013-11-21T09:03:10.274411-05:00 linux01 postfix/smtpd[7284]: warning: connect to 127.0.0.1:10031: Connection refused
2013-11-21T09:03:10.274883-05:00 linux01 postfix/smtpd[7284]: warning: problem talking to server 127.0.0.1:10031: Connection refused

###############################

issuing: systemctl status postgrey.service

returns this:

###############################

postgrey.service - LSB: Postgrey a greylisting server for postfix
          Loaded: loaded (/etc/init.d/postgrey)
          Active: failed (Result: exit-code) since Thu, 2013-11-21 08:58:04 EST; 5s ago
         Process: 7224 ExecStart=/etc/init.d/postgrey start (code=exited, status=7)
          CGroup: name=systemd:/system/postgrey.service
                  â 7121 /usr/sbin/postgrey -d --unix=/var/spool/postfix/postgrey/socket --auto-whitelist-clients
                  â 7235 /usr/sbin/postgrey -d --unix=/var/spool/postfix/postgrey/socket --auto-whitelist-clients

Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7224]: (Maybe you should just omit the defined()?)
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: Process Backgrounded
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: 2013/11/21-08:58:04 postgrey (type Net::Server::Multiplex) starting! pid(7235)
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: Using default listen value of 128
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: Binding to UNIX socket file /var/spool/postfix/postgrey/socket using SOCK_STREAM
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: Setting gid to "51 51"
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7235]: Setting uid to "302"
Nov 21 08:58:04 linux01.ashcortechnologies.com postgrey[7224]: ..failed
Nov 21 08:58:04 linux01.ashcortechnologies.com systemd[1]: Failed to start LSB: Postgrey a greylisting server for postfix.
Nov 21 08:58:04 linux01.ashcortechnologies.com systemd[1]: Unit postgrey.service entered failed state

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Rebooted server and now postgrey won't start

Ok, cluebringer (cbpolicyd) wasn't running and would not start via:

/etc/init.d/cbpolicyd start

returned:

/etc/init.d/cbpolicyd: line 11: /etc/init.d/functions: No such file or directory
/etc/init.d/cbpolicyd: line 14: .: /etc/sysconfig/network: is a directory
Shutting down cbpolicyd:
Starting cbpolicyd: /etc/init.d/cbpolicyd: line 25: daemon: command not found

########################
/etc/init.d/cbpolicyd file:

#!/bin/bash
#
# chkconfig: - 75 25
# description: Postfix Policy Daemon
# processname: httpd
# config: /etc/policyd/cluebringer.conf
# pidfile: /var/run/cbpolicyd.pid
# processname: cbpolicyd

# source function library
. /etc/init.d/functions

# Get config.
. /etc/sysconfig/network

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


RETVAL=0


start() {
        echo -n $"Starting cbpolicyd: "
        daemon /usr/sbin/cbpolicyd --config /etc/policyd/cluebringer.conf
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cbpolicyd
        return $RETVAL
}
........

if I run this manually:

/usr/sbin/cbpolicyd --config=/etc/policyd/cluebringer.conf start

I get the following and cluebringer starts.

defined(@array) is deprecated at /usr/lib/perl5/vendor_perl/5.16.2/Net/Server.pm line 211.
        (Maybe you should just omit the defined()?)

3 (edited by AshcorTech 2013-11-22 00:47:45)

Re: Rebooted server and now postgrey won't start

Ok, I still don't know why this was all screwed up but I was able to make /etc/init.d/cbpolicyd run by modifying it as such:

(Modifications marked with "##<------")

#!/bin/bash
#
# chkconfig: - 75 25
# description: Postfix Policy Daemon
# processname: httpd
# config: /etc/policyd/cluebringer.conf
# pidfile: /var/run/cbpolicyd.pid
# processname: cbpolicyd

# source function library
#. /etc/init.d/functions
. /etc/sysconfig/network/scripts/functions  ##<--------------------- changed this path
# Get config.
. /etc/sysconfig/network/config ##<---------------------Changed this path

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


RETVAL=0


start() {
        echo -n $"Starting cbpolicyd: "
        ## daemon /usr/sbin/cbpolicyd --config /etc/policyd/cluebringer.conf
        /usr/sbin/cbpolicyd --config=/etc/policyd/cluebringer.conf  ##<-------------- removed "daemon" and added "=" after --config
        RETVAL=$?
        echo
        # [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cbpolicyd  ##JSM 11/21/2013
        [ $RETVAL -eq 0 ] && touch /var/run/cbpolicyd/cbpolicyd ##<---------------------Added
        return $RETVAL
}


stop() {
        echo -n $"Shutting down cbpolicyd: "
        killproc cbpolicyd
        RETVAL=$?
        echo
        #[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cbpolicyd ##JSM 11/21/2013
        [ $RETVAL -eq 0 ] && rm -f /var/run/cbpolicyd/cbpolicyd   ##<---------------------Added
}

restart() {
        stop
        start
}


case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  condrestart)
        #if [ -f /var/lock/subsys/cbpolicyd ]; then ##JSM 11/21/2013   
        if [ -f /var/run/cbpolicyd/cbpolicyd ]; then   ##<---------------------Added
                restart
        fi
        ;;
  status)
        status cbpolicyd
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
        exit 1
esac

exit $RETVAL

###################################################

"/var/run/cbpolicyd/"  was created and chowned with cluebringer:root permissions set to 770