Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > cb363eebcf2756c4cb16e526efc09d35 > files > 7

dbmail-2.2.17-1.fc13.src.rpm

#!/bin/bash
#
# Startup script for the DBMail pop3 Server
#
# chkconfig: - 81 19
# description: DBMail is a mail server with a database backend.
# processname: dbmail-pop3d
# pidfile: /var/run/dbmail-pop3d.pid
# config: /etc/dbmail.conf
### BEGIN INIT INFO
# Provides:          dbmail-pop3d
# Required-Start:    $local_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Stop:      0 1 2 6
# Short-Description: Start dbmail-pop3d daemon
# Description:       dbmail-pop3d is the pop3 interface to the dbmail system.
### END INIT INFO
#

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

DBLIBDIR=/usr/lib/dbmail
export LD_LIBRARY_PATH=$DBLIBDIR:$LD_LIBRARY_PATH

if [ -f /etc/sysconfig/dbmail-pop3d ]; then
        . /etc/sysconfig/dbmail-pop3d
fi

# Path to the dbmail script.
exe=/usr/sbin/dbmail-pop3d
prog=dbmail-pop3d
RETVAL=0

start() {
    echo -n $"Starting $prog: "
    daemon $exe
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
    return $RETVAL
}
stop() {
    echo -n $"Stopping $prog: "
    killproc $exe
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
}
reload() {
    echo -n $"Reloading $prog: "
    killproc $exe -HUP
    RETVAL=$?
    echo
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status $exe
    RETVAL=$?
    ;;
  restart)
    stop
    start
    RETVAL=$?
    ;;
  condrestart)
    if [ -f /var/run/$prog.pid ] ; then
        stop
        start
        RETVAL=$?
    fi
    ;;
  reload)
    reload
    ;;
  *)
    echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}"
    RETVAL=3
esac

exit $RETVAL