copied rspamd from upstream to handle updates.

This commit is contained in:
Micha Glave
2019-06-12 22:31:11 +02:00
parent 697923b095
commit e6cc2a4a1b
6 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
/var/log/rspamd/rspamd.log {
daily
rotate 4
delaycompress
compress
notifempty
missingok
postrotate
if test -d /run/systemd/system ; then
systemctl kill -s USR1 --kill-who=main rspamd.service
else
test -r /run/rspamd.pid && kill -USR1 $(cat /run/rspamd.pid) &>/dev/null
fi
endscript
}

View File

@@ -0,0 +1,55 @@
#!/sbin/openrc-run
# Copyright 2015-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
RSPAMD_CONFIGFILE=${RSPAMD_CONFIGFILE:-"/etc/rspamd/rspamd.conf"}
RSPAMD_GROUP=${RSPAMD_GROUP:-rspamd}
RSPAMD_OPTS=${RSPAMD_OPTS:-""}
RSPAMD_PIDFILE=${RSPAMD_PIDFILE:-"/run/rspamd.pid"}
RSPAMD_USER=${RSPAMD_USER:-rspamd}
command="/usr/bin/rspamd"
command_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
start_stop_daemon_args=${RSPAMD_SSDARGS:-"--wait 1000"}
pidfile="${RSPAMD_PIDFILE}"
retry=${RSPAMD_TERMTIMEOUT:-"TERM/60/KILL/5"}
required_files="${RSPAMD_CONFIGFILE}"
description="Rapid spam filtering system"
extra_commands="checkconfig"
extra_started_commands="reload"
description_checkconfig="Validate rspamd's configuration"
description_reload="Sends rspamd a signal to reload its configuration"
depend() {
before mta
use dns redis
}
checkconfig() {
${command} -c "${RSPAMD_CONFIGFILE}" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} -t 1>/dev/null \
|| return 1
}
reload() {
checkconfig || return 1
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}
start_pre() {
if [ "${RC_CMD}" != "restart" ]; then
checkconfig || return 1
fi
}
stop_pre() {
if [ "${RC_CMD}" = "restart" ]; then
checkconfig || return 1
fi
}

View File

@@ -0,0 +1,26 @@
# /etc/conf.d/rspamd
# Configuration file
#RSPAMD_CONFIGFILE="/etc/rspamd/rspamd.conf"
# PID file
# If you should ever change this, remember to update
# "/etc/logrotate.d/rspamd", too.
#RSPAMD_PIDFILE="/run/rspamd.pid"
# You can use this configuration option to pass additional options to the
# start-stop-daemon, see start-stop-daemon(8) for more details.
# Per default we wait 1000ms after we have started the service to ensure
# that the daemon is really up and running.
#RSPAMD_SSDARGS="--wait 1000"
# The termination timeout (start-stop-daemon parameter "retry") ensures
# that the service will be terminated within a given time (60 + 5 seconds
# per default) when you are stopping the service.
#RSPAMD_TERMTIMEOUT="TERM/60/KILL/5"
# Options to rspamd
# See rspamd(8) for more details
# Notes:
# * Do not specify another CONFIGFILE but use the variable above to change the location
#RSPAMD_OPTS=""

View File

@@ -0,0 +1 @@
d /run/rspamd 0755 rspamd rspamd