view doc/dovecot-initd.sh @ 9308:1072d2b53f72 HEAD

login-proxy: If proxy destination is known to be down, fail immediately. We'll use a simple rule: If connection failed or timed out more recently than it succeeded AND there are currently no clients trying to connect to it, fail it. Since the connect isn't failed unless there is at least one client already trying to connect to it, the proxy notices immediately when the server comes back up and then starts serving it again.
author Timo Sirainen <tss@iki.fi>
date Wed, 12 Aug 2009 14:51:35 -0400
parents c2d55b298ec8
children
line wrap: on
line source

#!/bin/sh

# Example /etc/init.d/dovecot script. Change DAEMON if necessary.
# License is public domain.

DAEMON=/usr/local/sbin/dovecot

test -x $DAEMON || exit 1
set -e

base_dir=`$DAEMON -a|grep '^base_dir: '|sed 's/^base_dir: //'`
pidfile=$base_dir/master.pid

if test -f $pidfile; then
  running=yes
else
  running=no
fi

case "$1" in
  start)
    echo -n "Starting Dovecot"
    $DAEMON
    echo "."
    ;;
  stop)
    if test $running = yes; then
      echo "Stopping Dovecot"
      kill `cat $pidfile`
      echo "."
    else
      echo "Dovecot is already stopped."
    fi
    ;;
  reload)
    if test $running = yes; then
      echo -n "Reloading Dovecot configuration"
      kill -HUP `cat $pidfile`
      echo "."
    else
      echo "Dovecot isn't running."
    fi
    ;;
  restart|force-reload)
    echo -n "Restarting Dovecot"
    if test $running = yes; then
      kill `cat $pidfile`
      sleep 1
    fi
    $DAEMON
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
    exit 1
    ;;
esac

exit 0