view doc/dovecot-initd.sh @ 22930:bfeda12bb54a

lib-index: mail_index_sync_map() - Don't try to-resync extension updates This was done to call extension record sync handlers, but the previous commit removes them. Fixes a problem where obsolete cache offsets were used in some situations: - Some cache updates are from external transactions and some are from non-external transactions. This is because cache offset updates are being added by whatever the parent index transaction is. - When mail_index_sync_map() is mapping MAIL_INDEX_SYNC_HANDLER_FILE, it has already synced the map. But it's calling mail_index_sync_record() for non-external transactions to call expunge handlers and extension update handlers. It's calling the regular mail_index_sync_record() to do this work. - But mail_index_sync_record() is actually still updating the map. So now mail_index_sync_record() is called for all non-external cache updates, but not for external cache updates! And since these are somewhat randomly either external or non-external, the end result is that the cache offset may be obsolete.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 29 Apr 2018 12:31:23 +0300
parents 9b9d6a596688
children
line wrap: on
line source

#!/bin/sh
### BEGIN INIT INFO
# Provides:          dovecot
# Required-Start:    $local_fs $remote_fs $network $syslog $time
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Should-Start:      postgresql mysql slapd winbind
# Should-Stop:       postgresql mysql slapd winbind
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Dovecot init script
# Description:       Init script for dovecot services
### END INIT INFO

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

DAEMON=/usr/local/sbin/dovecot

# Uncomment to allow Dovecot daemons to produce core dumps.
#ulimit -c unlimited

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

base_dir=`$DAEMON config -h 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