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_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
13 start_stop_daemon_args=${RSPAMD_SSDARGS:-"--wait 1000"}
14 pidfile="${RSPAMD_PIDFILE}"
15 retry=${RSPAMD_TERMTIMEOUT:-"TERM/60/KILL/5"}
17 required_files="${RSPAMD_CONFIGFILE}"
19 description="Rapid spam filtering system"
21 extra_commands="checkconfig"
22 extra_started_commands="reload"
24 description_checkconfig="Validate rspamd's configuration"
25 description_reload="Sends rspamd a signal to reload its configuration"
33 ${command} -c "${RSPAMD_CONFIGFILE}" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} -t 1>/dev/null \
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