summaryrefslogtreecommitdiff
path: root/user/dovecot/dovecot.initd
diff options
context:
space:
mode:
authorLee Starnes <lee@canned-death.us>2020-05-06 00:53:22 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2020-05-06 00:53:22 +0000
commited2e5d142804bd69d296c39c6b861b8401718469 (patch)
treeb8ece634ba552bad49e2d395bbb89d3430c5a028 /user/dovecot/dovecot.initd
parent7d6a83dbf478235cc84f3cdbd0d1ccb82c8514a1 (diff)
downloadpackages-ed2e5d142804bd69d296c39c6b861b8401718469.tar.gz
packages-ed2e5d142804bd69d296c39c6b861b8401718469.tar.bz2
packages-ed2e5d142804bd69d296c39c6b861b8401718469.tar.xz
packages-ed2e5d142804bd69d296c39c6b861b8401718469.zip
user/dovecot: review fixes
- move default SSL key and cert stuff to a patch - use auth-system.conf instead of auth-passwdfile.conf because we have PAM - explain manual removal of *.la - other Adelification fixes
Diffstat (limited to 'user/dovecot/dovecot.initd')
-rw-r--r--user/dovecot/dovecot.initd40
1 files changed, 40 insertions, 0 deletions
diff --git a/user/dovecot/dovecot.initd b/user/dovecot/dovecot.initd
new file mode 100644
index 000000000..721f131ad
--- /dev/null
+++ b/user/dovecot/dovecot.initd
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+
+[ "$RC_SVCNAME" != "${RC_SVCNAME##*.}" ] && instance=${RC_SVCNAME##*.}
+
+description="Secure POP3/IMAP server"
+
+cfgfile=/etc/dovecot/dovecot${instance:+.$instance}.conf
+pidfile=$(doveconf -c $cfgfile -h base_dir 2>/dev/null)/master.pid
+command=/usr/sbin/dovecot
+command_args=${instance:+-c $cfgfile}
+required_files="$cfgfile"
+extra_started_commands="reload reopen"
+description_reload="Reload configuration"
+description_reopen="Reopen log files"
+
+depend() {
+ need localmount net
+ before mta
+ after bootmisc firewall ldap mysql ntp-client ntpd postgresql saslauthd slapd
+ use logger
+}
+
+start_pre() {
+ ebegin
+ doveconf -c $cfgfile -x >/dev/null 2>&1 && \
+ checkpath --directory ${pidfile%/*}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading $RC_SVCNAME configs and restarting auth/login processes"
+ start_pre && start-stop-daemon --signal HUP --pidfile $pidfile
+ eend $?
+}
+
+reopen() {
+ ebegin "Reopening $RC_SVCNAME log files"
+ start-stop-daemon --signal USR1 --pidfile $pidfile
+ eend $?
+}