RHEL / CentOS init script broken in 2.3.0-Beta4?

From: Steve Jenkins <stevejenkins_at_gmail.com>
Date: Thu, 27 Jan 2011 21:31:02 -0800

I'm trying the following init script on CentOS with OpenDKIM
2.3.0-Beta4. I could have sworn this worked OK for me on Beta 1, but
now I'm getting:

# service opendkim status
opendkim dead but subsys locked

Did anything change since Beta1 that might make break the status
check? The restart function is also broken - it will fail to stop the
existing process but then starts a new one (at which point I need to
manually kill the process(es)).

Thanks,

SteveJ

========================================================
#!/bin/bash
#
# opendkim Start and stop OpenDKIM.

# chkconfig: - 41 61
# description: OpenDKIM implements the DomainKeys Identified Mail
(DKIM) service and a milter-based filter application that can plug in
to any milter-aware MTA.
# processname: opendkim
# pidfile: /var/run/opendkim/opendkim.pid

### BEGIN INIT INFO
# Provides: opendkim
# Required-Start: opendkim
# Required-Stop: opendkim
# Short-Description: Start and stop OpenDKIM
# Description: DKIM milter
### END INIT INFO

# OpenDKIM startup script v1.2 for RHEL/CentOS/Fedora by Steve Jenkins
(SteveJenkins.com) - 12-01-2011
# Based on a script by Andrew Colin Kissa (TopDog) for dkim-milter - 28-05-2009
# Additional functionality to prevent multiple instances and a reload
handler by Chris LaJoie - 11-01-2011

. /etc/rc.d/init.d/functions

DAEMON=/usr/local/sbin/opendkim
PID_FILE=/var/run/opendkim/opendkim.pid
CONF_FILE=/etc/opendkim.conf
RETVAL=0

start() {
 echo -n $"Starting OpenDKIM Milter: "
 daemon --pidfile=$PID_FILE $DAEMON -x $CONF_FILE
 RETVAL=$?
 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/opendkim
 echo
 return $RETVAL
}

stop() {
 echo -n $"Stopping OpenDKIM Milter: "
 killproc -p $PID_FILE opendkim
 RETVAL=$?
 echo
 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/opendkim
 return $RETVAL
}

restart() {
 stop
 start
}

# PART 1/2 OF RELOAD HANDLER FOR OPENDKIM VERSION 2.3+
# UNCOMMENT THE FOLLOWING 7 LINES ONLY IF USING OPENDKIM 2.3+
reload() {
 echo -n $"Reloading OpenDKIM Milter config: "
 killproc -p $PID_FILE opendkim -SIGUSR1
 RETVAL=$?
 echo
 return $RETVAL
}

case "$1" in
 start)
  start
  ;;
 stop)
  stop
  ;;
# PART 2/2 OF RELOAD HANDLER FOR OPENDKIM VERSION 2.3+
# UNCOMMENT THE FOLLOWING 3 LINES ONLY IF USING OPENDKIM 2.3+
 reload)
  reload
  ;;
 restart)
  restart
  ;;
 status)
  status -p $PID_FILE opendkim
  ;;
 condrestart)
  [ -f /var/lock/subsys/opendkim ] && restart || :
  ;;
 *)
  echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
  exit 1
esac

exit $?
Received on Fri Jan 28 2011 - 05:31:17 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:20:15 PST