Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 172678402dc25221cbc2711090f0a934 > files > 82

tmda-1.0.3-5mdv2008.1.noarch.rpm

#!/bin/bash
#
# Startup script for the TMDA ofmipd server (SysV/RedHat style)
#
# If you are installing the init files by hand, you should copy the these
# files to the following locations:
#   contrib/tofmipd.init      -> /etc/rc.d/init.d/tofmipd
#   contrib/tofmipd.sysconfig -> /etc/sysconfig/tofmipd
#
# Then you must install the service by issuing the following command:
#   chkconfig --add tofmipd
#
# You can then start the service with the following command:
#   service tofmipd start
#
# chkconfig: 2345 87 13
# description: tofmipd is a server that allows tagging of outgoing mail \
#          for the TMDA system.
# processname: tofmipd
# pidfile: /var/run/tofmipd.pid
# config: /etc/sysconfig/tofmipd

# Path to the script, server binary, and short-form for messages.
program=/usr/bin/tmda-ofmipd
progname=tofmipd
lockfile=/var/lock/subsys/tofmipd
pidfile=/var/run/tofmipd.pid
RETVAL=0

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

if [ -f /etc/sysconfig/$progname ]; then
        . /etc/sysconfig/$progname
fi

start() {
        echo -n $"Starting $progname: "
        daemon $program $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch $lockfile
        return $RETVAL
}
stop() {
	echo -n $"Stopping $progname: "
	killproc $program
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f $lockfile $pidfile
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status $program
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  condrestart)
	if [ -f $pidfile ] ; then
		stop
		start
	fi
	;;
  *)
	echo $"Usage: $progname {start|stop|restart|condrestart|status}"
	exit 1
esac

exit $RETVAL