#!/bin/sh # opendkim DomainKeys Identified Mail service # chkconfig: 345 85 15 # 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 # config: /etc/opendkim/opendkim.conf # Source function library . /etc/rc.d/init.d/functions prog="/usr/sbin/opendkim" svname="opendkim" sysconfig="/etc/sysconfig/$svname" lockfile="/var/lock/subsys/$svname" pidfile="/var/run/$svname/$svname.pid" conffile="/etc/opendkim/$svname.conf" # Get service config [ -f $sysconfig ] && . $sysconfig start() { # Check if the service is already running? if [ ! -f $lockfile ]; then msg_starting "$svname" daemon $prog -x $conffile -P $pidfile RETVAL=$? [ $RETVAL -eq 0 ] && touch $lockfile else msg_already_running "$svname" fi } stop() { # Stop daemons. if [ -f $lockfile ]; then msg_stopping "$svname" killproc -p $pidfile $prog RETVAL=$? rm -f $lockfile $pidfile >/dev/null 2>&1 else msg_not_running "$svname" fi } reload() { if [ -f $lockfile ]; then msg_reloading "$svname" killproc -p $pidfile $prog -HUP RETVAL=$? else msg_not_running "$svname" RETVAL=7 fi } condrestart() { if [ ! -f $lockfile ]; then msg_not_running "$svname" RETVAL=$1 return fi stop start } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; try-restart) condrestart 0 ;; status) status --pidfile $pidfile $svname RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|try-restart|status}" exit 3 ;; esac exit $RETVAL