2 # Copyright 2015-2019 Gentoo Authors
3 # Distributed under the terms of the GNU General Public License v2
5 RSPAMD_CONFIGFILE=${RSPAMD_CONFIGFILE:-"/etc/rspamd/rspamd.conf"}
6 RSPAMD_GROUP=${RSPAMD_GROUP:-rspamd}
7 RSPAMD_OPTS=${RSPAMD_OPTS:-""}
8 RSPAMD_PIDFILE=${RSPAMD_PIDFILE:-"/run/rspamd.pid"}
9 RSPAMD_USER=${RSPAMD_USER:-rspamd}
11 command="/usr/bin/rspamd"
12 command_rspamadm="/usr/bin/rspamadm"
13 command_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
14 start_stop_daemon_args=${RSPAMD_SSDARGS:-"--wait 1000"}
15 pidfile="${RSPAMD_PIDFILE}"
16 retry=${RSPAMD_TERMTIMEOUT:-"TERM/60/KILL/5"}
18 required_files="${RSPAMD_CONFIGFILE}"
20 description="Rapid spam filtering system"
22 extra_commands="checkconfig"
23 extra_started_commands="reload"
25 description_checkconfig="Validate rspamd's configuration"
26 description_reload="Sends rspamd a signal to reload its configuration"
34 ${command_rspamadm} configtest 1>/dev/null || return 1
38 checkconfig || return 1
40 ebegin "Reloading ${SVCNAME}"
41 start-stop-daemon --signal HUP --pidfile "${pidfile}"
46 if [ "${RC_CMD}" != "restart" ]; then
47 checkconfig || return 1
52 if [ "${RC_CMD}" = "restart" ]; then
53 checkconfig || return 1