Hi Eric B.
I'll give You my init.d/dovecot ! (rel 1.2.10) the logging is done by
dovecot (set log path in dovecot.conf)
Remember to make changes according to Your paths in the init file
#!/bin/bash
#
# /etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: - 65 35
# description: Dovecot Imap Server
# processname: dovecot
# config: /etc/dovecot.conf
# config: /etc/sysconfig/dovecot
# pidfile: /var/run/dovecot/master.pid
### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: $remote_fs
# Should-Stop: $remote_fs
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop Dovecot Imap server
# Description: Dovecot is an IMAP server for Linux/UNIX-like systems,
# written with security primarily in mind. It also contains
# a small POP3 server.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
if [ -f /etc/sysconfig/dovecot -a $UID -eq 0 ]; then
. /etc/sysconfig/dovecot
fi
RETVAL=0
prog="Dovecot Imap"
exec="/usr/sbin/dovecot"
config="/etc/dovecot.conf"
pidfile="/var/run/dovecot/master.pid"
lockfile="/var/lock/subsys/dovecot"
start() {
[ $UID -eq 0 ] || exit 4
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon --pidfile $pidfile $exec $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lockfile
echo
}
stop() {
[ $UID -eq 0 ] || exit 4
echo -n $"Stopping $prog: "
killproc -p $pidfile $exec
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $lockfile
echo
}
reload() {
[ $UID -eq 0 ] || exit 4
echo -n $"Reloading $prog: "
killproc -p $pidfile $exec -HUP
RETVAL=$?
echo
}
#
# See how we were called.
#
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload|restart)
stop
sleep 1
start
RETVAL=$?
;;
condrestart|try-restart)
if [ -f $lockfile ]; then
stop
sleep 3
start
fi
;;
status)
status -p $pidfile $exec
RETVAL=$?
;;
*)
echo $"Usage: $0
{condrestart|try-restart|start|stop|restart|reload|forc
e-reload|status}"
RETVAL=2
[ "$1" = 'usage' ] && RETVAL=0
esac
exit $RETVAL
Cheers
Finn
On 04-03-2011 19:28, Eric Broch wrote:
On 3/4/2011 10:55 AM, Eric Shubert wrote:
I had a little difficulty with keeping dovecot up at first. It's very
sensitive to time, and I'm running VMs. I think I got the time
situation under control, but I keep this script running as a cron job
every minute just in case:
[root@tacs-mail ~]# cat /usr/local/bin/monitor_dovecot
#!/bin/sh
# check if dovecot's running, and start it if it's not
# shubes - 20090206 - created
service dovecot status>/dev/null 2>&1 || \
service dovecot start>/dev/null 2>&1
[root@tacs-mail ~]#
As you can see, I'm not using supervise for dovecot. I'm not sure
there's really a good reason to do so. (when in Rome...)
Eric,
So, you create the file /etc/rc.d/init.d/dovecot, add it as a service
using 'chkconfig --add dovecot' and start it at boot-time using
'chkconfig dovecot on' ?
If so, what does you /etc/rc.d/init.d/dovecot file look like? And, as a
consequence, I suppose, I would remove /var/qmail/supervise/dovecot/run
How do you implement the logging mechanism, through qmailctl and
/var/qmail/supervise/dovecot/log/run ?
Eric B.
---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group
(www.vickersconsulting.com)
Vickers Consulting Group offers Qmailtoaster support and installations.
If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group
(www.vickersconsulting.com)
Vickers Consulting Group offers Qmailtoaster support and installations.
If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]