aboutsummaryrefslogblamecommitdiffstats
path: root/testing/rspamd/rspamd.initd
blob: a20f78457e6366df95df32a168f4cac5af5f2e5f (plain) (tree)
1
2
3
4
5
6
7
8
9


                                         

                      
                                           


                                                         
                         
                                      
                                         
                                     







                           

                                                                           




                                     
                                                         

               





                                                          
#!/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 reopen"
description_reload="Reload configuration"
description_reopen="Reopen log files"

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 $?
}

reopen() {
	ebegin "Reopening ${SVCNAME} log files"
	start-stop-daemon --signal USR1 --pidfile $pidfile
	eend $?
}