aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rspamd/rspamd.initd
blob: 0fd5b9323b5fbe8ee9ad02225fd91ad2f6548c2f (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
#!/sbin/openrc-run

description="Rapid spam filtering system"
user=${user:-rspamd}
group=${group:-rspamd}
cfgfile=${cfgfile:-/etc/rspamd/rspamd.conf}
pidfile=${pidfile:-/run/rspamd/rspamd.pid}
command=/usr/sbin/rspamd
command_args="-u $user -g $group -c $cfgfile -p $pidfile"
required_files="$cfgfile"
extra_started_commands="reload"
description_reload="Reload configuration"

depend() {
	need localmount net
	before exim postfix
}

start_pre() {
	ebegin
	checkpath --directory --mode 750 --owner $user:$group ${pidfile%/*}
	$command $command_args -t >/dev/null 2>>${startuplog:-/dev/null}
	eend $?
}

reload() {
	ebegin "Reloading ${SVCNAME}"
	start-stop-daemon --signal HUP --pidfile $pidfile
	eend $?
}