aboutsummaryrefslogblamecommitdiffstats
path: root/testing/rspamd/rspamd.initd
blob: 5189e493486ef38a7ae535c905a55428d3505635 (plain) (tree)




























                                                                                              
#!/sbin/openrc-run

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

depend() {
	need localmount net
	before exim postfix
}

start_pre() {
	ebegin
	[ "$cfgfile" = "/etc/rspamd/rspamd.conf" ] || command_args="$command_args -c $cfgfile"
	checkpath --directory --mode 750 --owner rspamd:rspamd "${pidfile%/*}"
	$command $command_args -t &>/dev/null
	eend $?
}

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