[Dovecot] Start dovecot at boot.

lampacz at gmail.com lampacz at gmail.com
Wed Feb 14 13:45:51 UTC 2007


Helo, here i my debian startup script:

and to runlevel copy script (in /etc/init.d directory): 
update-rc.d dovecot defaults 98 02

#!/bin/sh -e

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/dovecot/bin/dovecot
DAEMON=/usr/local/dovecot/sbin/dovecot
NAME=dovecot
DESC="IMAP server"

test -x $DAEMON || exit 0

case "$1" in
        start)
                echo -n "Starting $DESC: $NAME"
                start-stop-daemon --start --quiet --oknodo --exec $DAEMON
                echo "."
        ;;
        stop)
                echo -n "Stopping $DESC: $NAME"
                start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
                echo "."
        ;;
        restart|force-reload)
                echo -n "Restarting $DESC: $NAME"
                start-stop-daemon --stop --quiet --exec $DAEMON
                sleep 1
                start-stop-daemon --start --quiet --exec $DAEMON
                echo "."
        ;;
        *)
                echo "Usage: $0 {start|stop|restart|force-reload}" >&2
                exit 1
        ;;
esac

exit 0

Dne středa 14 únor 2007 14:28 Gert Brinkmann napsal(a):
> Ivan Arteaga wrote:
> > I recently installed dovecot 1.0rc15 on centos, installation went fine,
> > it installed under /usr/local/ but I cannot start the dovecot service
> > automatically.
>
> Take a look to the start/stop-Scripts in /etc/init.d/. Take one of these
> (maybe "atd" or whatever is installed) and copy it to "dovecot". Such a
> script is simple to understand normally, so you can edit it to
> start/stop your manually installed dovecot easily. (Maybe there comes
> such a script within the dovecot-tarball? I am using the deb-package
> that is included in debian/sid that does set up everything automatically.)
>
> Then you need to place symlinks to the runlevels to start/stop the
> daemon. Here on a debian-system there are:
>
> /etc/rc0.d/K21dovecot -> ../init.d/dovecot
> /etc/rc1.d/K21dovecot -> ../init.d/dovecot
> /etc/rc2.d/S21dovecot -> ../init.d/dovecot
> /etc/rc3.d/S21dovecot -> ../init.d/dovecot
> /etc/rc4.d/S21dovecot -> ../init.d/dovecot
> /etc/rc5.d/S21dovecot -> ../init.d/dovecot
> /etc/rc6.d/K21dovecot -> ../init.d/dovecot
>
> Maybe this helps?
>
> Gert


More information about the dovecot mailing list