Updated OpenDKIM RedHat Init Script (hopefully in time for the new release!)

From: Steve Jenkins <stevejenkins_at_gmail.com>
Date: Tue, 15 Feb 2011 13:39:41 -0800

While fiddling with Beta8, I noticed a small issue with my RHEL /
CentOS / Fedora init script (which is in the contrib dir).

If OpenDKIM is already running and you do "service opendkim start" you
get a big fat pile of nothing. It simply says:

"Starting OpenDKIM Milter:"

That's unacceptable for a version of the program that's going to be
released on my 40th birthday! :)

So I changed the start() function to read:

start() {
        echo -n $"Starting OpenDKIM Milter: "
        if [ -f $PID_FILE ]; then
                PID=`cat $PID_FILE`
                echo OpenDKIM already running as pid $PID
                exit 2;
        else
                daemon --pidfile=$PID_FILE $DAEMON -x $CONF_FILE
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/opendkim
                echo
                return $RETVAL
        fi
}

Now if OpenDKIM already running and you ask it to start, it will tell
you and spit out the pid. I also updated the "Description:" in the
INIT INFO block to match the one up top.

Version 1.3 of the RedHat init script is attached. Anyone running
OpenDKIM on Fedora, CentOS, or RHEL is invited to try it out. It
supports start (now "smarter"), stop, status, reload, restart, and
condrestart.

I'm hoping it can make the /contrib/ directory the final release. And
speaking of which, Murray, you may want to consider renaming that
directory /contrib/redhat instead of /contrib/rhel since the also
works on Fedora (which isn't technically an "enterprise" flavor of
RH).

Thanks!

SteveJ



Received on Tue Feb 15 2011 - 21:39:52 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:33:08 PST