[Dovecot] Start dovecot at boot.

Luis Venegas lvenegas at indecs.com
Wed Feb 14 17:57:10 UTC 2007


Hi.,

At /etc/rc.d/init.d  put a file named dovecot

############
############
#!/bin/bash
#
#       /etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: - 65 35
# description: Dovecot Imap Server
# processname: dovecot
# Source function library.
. /etc/init.d/functions

test -x /usr/local/sbin/dovecot || exit 0

RETVAL=0
prog="Dovecot Imap"

start() {
        echo -n $"Starting $prog: "
        daemon /usr/local/sbin/dovecot
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
        echo
}

stop() {
        echo -n $"Stopping $prog: "
        killproc /usr/local/sbin/dovecot
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot
        echo
}

#
#       See how we were called.
#
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  reload|restart)
        stop
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/dovecot ]; then
            stop
            start
        fi
        ;;
  status)
        status /usr/local/sbin/dovecot
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
        exit 1
esac

exit $RETVAL

############
############

And then "chkconfig dovecot on"

Luis.

-----Mensaje original-----
De: dovecot-bounces at dovecot.org [mailto:dovecot-bounces at dovecot.org] En
nombre de Ivan Arteaga
Enviado el: Miércoles, 14 de Febrero de 2007 10:02
Para: 'Dovecot Mailing List'
Asunto: [Dovecot] Start dovecot at boot.


Hi List,

I recently installed dovecot 1.0rc15 on centos, installation went fine, it
installed under /usr/local/ but I cannot start the dovecot service
automatically. I tried with chkconfig but it told me the dovecot service is
not supported by chkconfig. Can anybody give me a tip about how to get done
with this?

I will appreciate any help.

Regards, 

--Ivan. 






More information about the dovecot mailing list