dovecot 2.2.9-1ubuntu2 misses init script to start

Bug #1319817 reported by doc brown
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dovecot (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

#cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

#dpkg -l|grep dovecot
ii dovecot-core 1:2.2.9-1ubuntu2 amd64 secure POP3/IMAP server - core files
ii dovecot-imapd 1:2.2.9-1ubuntu2 amd64 secure POP3/IMAP server - IMAP daemon
ii dovecot-managesieved 1:2.2.9-1ubuntu2 amd64 secure POP3/IMAP server - ManageSieve server
ii dovecot-sieve 1:2.2.9-1ubuntu2 amd64 secure POP3/IMAP server - Sieve filters support

#ls -lsa /etc/init.d|grep dovecot

I'm missing the init or start script for dovecot on a fresh installed Trusty Tahr system. I'm not sure if it is possible to simply use the dovecot 1.2.9-1ubuntu6.5 init script.

doc brown (docbrown)
affects: mir → dovecot
Revision history for this message
doc brown (docbrown) wrote :

The same for 2.2.9-1ubuntu2.1

affects: dovecot → dovecot (Ubuntu)
Revision history for this message
doc brown (docbrown) wrote :
Download full text (5.6 KiB)

Old dovecot 1 init.d script is working well.

It's this one:

#! /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

# Author: Miquel van Smoorenburg <email address hidden>.
# Modified for Debian GNU/Linux
# by Ian Murdock <email address hidden>.
#

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="IMAP/POP3 mail server"
NAME=dovecot
DAEMON=/usr/sbin/dovecot
DAEMON_ARGS=""
SCRIPTNAME=/etc/init.d/$NAME
CONF=/etc/dovecot/${NAME}.conf

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Exit if the configuration file doesn't exist
[ -f "$CONF" ] || exit 0

# Exit if explicitly told to
[ "$ENABLED" != "0" ] || exit 0

# Allow core dumps if requested
[ "$ALLOW_COREDUMPS" != "1" ] || ulimit -c unlimited

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# conf file readable?
if [ ! -r ${CONF} ]; then
  log_daemon_msg "${CONF}: not readable" "$NAME" && log_end_msg 1;
  exit 1;
fi

# dont check for inetd.conf if its not installed
if [ -f /etc/inetd.conf ]; then
  # The init script should do nothing if dovecot or another imap/pop3 server
  # is being run from inetd, and dovecot is configured to run as an imap or
  # pop3 service
  for p in `sed -r "s/^ *(([^:]+|\[[^]]+]|\*):)?(pop3s?|imaps?)[ \t].*/\3/;t;d" \
    /etc/inetd.conf`
  do
    for q in `sed -r "s/^[ \t]*protocols[ \t]*=[ \t]*(([^\"]*)|\"(.*)\")/\2\3/;t;d" \
      ${CONF}`
    do
      if [ $p = $q ]; then
        exit 0
      fi
    done
  done
fi

# determine the location of the PID file
# overide by setting base_dir in conf file or PIDBASE in /etc/defaults/$NAME
PIDBASE=${PIDBASE:-`sed -r "s/^[ \t]*base_dir[ \t]*=[ \t]*([^ \t]*)/\1/;t;d" ${CONF}`}
PIDFILE=${PIDBASE:-/var/run/dovecot}/master.pid

#
# Function that starts the daemon/service
#
do_start()
{
    # Return
    # 0 if daemon has been started
    # 1 if daemon was already running
    # 2 if daemon could not be started
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test -- -c ${CONF} > /dev/null \
        || return 1
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -c ${CONF} \
        $DAEMON_ARGS \
        || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
    # Return
    # 0 if daemon has been stopped
    # 1 if daemon was already stopped
    # 2 if daemon could not be stopped
    # other if a failure occurred
    start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name ${DAEMON##*/}
    RETVAL="$?"...

Read more...

Revision history for this message
Robie Basak (racb) wrote :

Since Ubuntu uses upstart, the correct interface to manage services is with the "service" command, not by calling init.d scripts directly.

dovecot in Trusty is managed by an upstart script. This is defined in /etc/init/dovecot.conf. That /etc/init.d/dovecot doesn't exist is by design, so I'm marking this bug as Invalid. If you disagree, please explain and change the bug status back to New.

Changed in dovecot (Ubuntu):
status: New → Invalid
Revision history for this message
doc brown (docbrown) wrote :

You're perfectly right. For whatever reason, autocompletion for dovecot upstart isn't working. So I overlooked it.

Thanks for your hint.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.