Gentoo Archives: gentoo-commits

From: "Eray Aslan (eras)" <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-mail/dovecot/files: dovecot.init-r4
Date: Sat, 01 Dec 2012 10:41:01
Message-Id: 20121201104050.1BB8B2167D@flycatcher.gentoo.org
1 eras 12/12/01 10:40:50
2
3 Added: dovecot.init-r4
4 Log:
5 Init script: need net -> use net
6
7 (Portage version: 2.2.0_alpha143/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
8
9 Revision Changes Path
10 1.1 net-mail/dovecot/files/dovecot.init-r4
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/files/dovecot.init-r4?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/files/dovecot.init-r4?rev=1.1&content-type=text/plain
14
15 Index: dovecot.init-r4
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2012 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License, v2 or later
20 # $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/files/dovecot.init-r4,v 1.1 2012/12/01 10:40:49 eras Exp $
21
22 extra_started_commands="reload"
23
24 depend() {
25 need localmount
26 before postfix
27 after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd
28 use logger net
29 }
30
31 checkconfig() {
32 DOVECOT_INSTANCE=${SVCNAME##*.}
33 if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
34 DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
35 else
36 DOVECOT_CONF=/etc/dovecot/dovecot.conf
37 fi
38 if [ ! -e ${DOVECOT_CONF} ]; then
39 eerror "You will need an ${DOVECOT_CONF} first"
40 return 1
41 fi
42 if [ -x /usr/sbin/dovecot ]; then
43 DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | grep '^base_dir = ' | sed 's/^base_dir = //')
44 else
45 eerror "dovecot not executable"
46 return 1
47 fi
48 DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/run/dovecot}
49 DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid
50 }
51
52 start() {
53 checkconfig || return 1
54 ebegin "Starting ${SVCNAME}"
55 start-stop-daemon --start --exec /usr/sbin/dovecot \
56 --pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}"
57 eend $?
58 }
59
60 stop() {
61 checkconfig || return 1
62 ebegin "Stopping ${SVCNAME}"
63 start-stop-daemon --stop --exec /usr/sbin/dovecot \
64 --pidfile "${DOVECOT_PIDFILE}"
65 eend $?
66 }
67
68 reload() {
69 checkconfig || return 1
70 ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes"
71 start-stop-daemon --signal HUP --exec /usr/sbin/dovecot \
72 --pidfile "${DOVECOT_PIDFILE}"
73 eend $?
74 }