40 lines
949 B
Plaintext
40 lines
949 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
description="Secure POP3/IMAP server"
|
|
|
|
cfgfile=${cfgfile:-/etc/dovecot/dovecot.conf}
|
|
pidfile=$(doveconf -c $cfgfile -h base_dir 2>/dev/null)/master.pid
|
|
command=/usr/sbin/dovecot
|
|
command_args="-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 ntp-client ntpd postgresql
|
|
use logger
|
|
}
|
|
|
|
start_pre() {
|
|
ebegin "Checking dovecot config"
|
|
doveconf -c $cfgfile -x >/dev/null
|
|
eend $?
|
|
checkpath --directory ${pidfile%/*}
|
|
checkpath -m740 -o mail:mail -d ${maildir:-/var/mail}
|
|
}
|
|
|
|
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 $?
|
|
}
|