aboutsummaryrefslogtreecommitdiffstats
path: root/testing/opendmarc/opendmarc.initd
blob: e67caebd8cddf832af3ca07f969f1bb350fe1ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/openrc-run
supervisor=supervise-daemon

extra_commands="checkconfig"

description="Domain-based Message Authentication, Reporting & Conformance (DMARC) Milter"
description_checkconfig="Check configuration file"

: ${cfgfile:="/etc/opendmarc/$RC_SVCNAME.conf"}
: ${command_user:="opendmarc:mail"}

command="/usr/sbin/opendmarc"
command_args="-f -c $cfgfile ${command_args:-}"
pidfile="/run/opendmarc/$RC_SVCNAME.pid"

required_files="$cfgfile"

depends() {
	use dns logger net
	before mta
}

start_pre() {
	checkpath -d -m 750 -o "$command_user" "${pidfile%/*}" || return 1
	$command -c "$cfgfile" -n
}

checkconfig() {
	ebegin "Checking $name configuration"
	$command -c "$cfgfile" -n
	eend $?
}