how come the service script is differs from
http://wiki.qmailtoaster.com/index.php/Replacing_Courier_IMAP_with_Dovecot_IMAP#Building_the_services
just curious??
On 04-Mar-11 23:41, Eric Broch wrote:
Nigel,
Here are the 'cat' of dovecot and dovecot loggin I use...
for dovecot...
/var/qmail/supervise/dovecot/run
[root@poweredgeT105 dovecot]# cat run
#!/bin/sh
#
# service-dovecot-run
# John Simpson <j...@jms1.net> 2008-05-13
#
# 2009-02-12 jms1 - added code to find and check pidfile. if it exists but
# doesn't point to a running "dovecot" process, delete it before running
# dovecot itself. (i actually did this back in 2008-06 but forgot to
put it
# on the web site, thanks to Ventyslav Vassilev for reminding me
about it.)
#
###############################################################################
#
# Copyright (C) 2008,2009 John Simpson.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
# note: DO NOT FORGET to add the "-F" option to the end of the command!
CMD="/usr/local/sbin/dovecot -F"
# may need to be removed
PIDFILE="/usr/local/var/run/dovecot/master.pid"
if [ -f $PIDFILE ]
then
PID=`cat $PIDFILE`
if ps -p $PID -o comm= | grep -q dovecot
then
echo "ERROR: dovecot[$PID] is already running"
sleep 5
exit 1
else
rm -v $PIDFILE
fi
fi
echo "command line: $CMD"
exec env - PATH="/usr/bin:/bin" $CMD 2>&1
echo "exec failed"
sleep 5
And, for dovecot logging....
/var/qmail/supervise/dovecot/log/run
[root@poweredgeT1052 log]# cat run
#!/bin/sh
LOGSIZE=`cat /var/qmail/control/logsize`
LOGCOUNT=`cat /var/qmail/control/logcount`
exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s$LOGSIZE
n$LOGCOUNT /var/log/qmail/dovecot 2>&1
Eric