dovecot-1.2: Added example init.d/dovecot script.
dovecot at dovecot.org
dovecot at dovecot.org
Sat May 2 00:15:39 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/c2d55b298ec8
changeset: 9010:c2d55b298ec8
user: Timo Sirainen <tss at iki.fi>
date: Fri May 01 17:15:31 2009 -0400
description:
Added example init.d/dovecot script.
diffstat:
2 files changed, 60 insertions(+)
doc/Makefile.am | 1
doc/dovecot-initd.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
diffs (74 lines):
diff -r 4fd7b98bcff9 -r c2d55b298ec8 doc/Makefile.am
--- a/doc/Makefile.am Fri May 01 17:07:38 2009 -0400
+++ b/doc/Makefile.am Fri May 01 17:15:31 2009 -0400
@@ -13,6 +13,7 @@ doc_DATA = \
securecoding.txt
EXTRA_DIST = \
+ dovecot-initd.sh \
mkcert.sh \
dovecot-openssl.cnf \
solr-schema.xml \
diff -r 4fd7b98bcff9 -r c2d55b298ec8 doc/dovecot-initd.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/dovecot-initd.sh Fri May 01 17:15:31 2009 -0400
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Example /etc/init.d/dovecot script. Change DAEMON if necessary.
+# License is public domain.
+
+DAEMON=/usr/local/sbin/dovecot
+
+test -x $DAEMON || exit 1
+set -e
+
+base_dir=`$DAEMON -a|grep '^base_dir: '|sed 's/^base_dir: //'`
+pidfile=$base_dir/master.pid
+
+if test -f $pidfile; then
+ running=yes
+else
+ running=no
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting Dovecot"
+ $DAEMON
+ echo "."
+ ;;
+ stop)
+ if test $running = yes; then
+ echo "Stopping Dovecot"
+ kill `cat $pidfile`
+ echo "."
+ else
+ echo "Dovecot is already stopped."
+ fi
+ ;;
+ reload)
+ if test $running = yes; then
+ echo -n "Reloading Dovecot configuration"
+ kill -HUP `cat $pidfile`
+ echo "."
+ else
+ echo "Dovecot isn't running."
+ fi
+ ;;
+ restart|force-reload)
+ echo -n "Restarting Dovecot"
+ if test $running = yes; then
+ kill `cat $pidfile`
+ sleep 1
+ fi
+ $DAEMON
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
More information about the dovecot-cvs
mailing list