diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-01-16 04:15:11 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-01-16 04:15:44 +0100 |
commit | c334938edc52f23ed95834e3b8a658f2e76c53cb (patch) | |
tree | 7751ec26f7fbddbbff48d633d17779f9493f63aa /mail-filter/rspamd/files | |
parent | app-crypt/nitrocli: Bump version to 0.2.2 (diff) | |
download | gentoo-c334938edc52f23ed95834e3b8a658f2e76c53cb.tar.gz gentoo-c334938edc52f23ed95834e3b8a658f2e76c53cb.tar.bz2 gentoo-c334938edc52f23ed95834e3b8a658f2e76c53cb.zip |
mail-filter/rspamd: bump to v1.8.3
- runscript rewritten
- username used in systemd unit adjusted for Gentoo
- priv escalation via PID file fixed
- dev-util/ragel version constraint removed (package
is now compatible with ragel-7)
Closes: https://github.com/gentoo/gentoo/pull/10598
Closes: https://github.com/gentoo/gentoo/pull/10561
Closes: https://github.com/gentoo/gentoo/pull/10057
Package-Manager: Portage-2.3.56, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'mail-filter/rspamd/files')
-rw-r--r-- | mail-filter/rspamd/files/rspamd-r1.logrotate | 16 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-r6.init | 55 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd.conf | 26 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd.tmpfile | 1 |
4 files changed, 98 insertions, 0 deletions
diff --git a/mail-filter/rspamd/files/rspamd-r1.logrotate b/mail-filter/rspamd/files/rspamd-r1.logrotate new file mode 100644 index 000000000000..5cb2fdd55e07 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-r1.logrotate @@ -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 +} + diff --git a/mail-filter/rspamd/files/rspamd-r6.init b/mail-filter/rspamd/files/rspamd-r6.init new file mode 100644 index 000000000000..8c31fd7d0278 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-r6.init @@ -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 +} diff --git a/mail-filter/rspamd/files/rspamd.conf b/mail-filter/rspamd/files/rspamd.conf new file mode 100644 index 000000000000..f3a65cbb20a7 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd.conf @@ -0,0 +1,26 @@ +# /etc/conf.d/rspamd + +# Configuration file +#RSPAMD_CONFIGFILE="/etc/rsyslog.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="" diff --git a/mail-filter/rspamd/files/rspamd.tmpfile b/mail-filter/rspamd/files/rspamd.tmpfile new file mode 100644 index 000000000000..9f7a2c46c315 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd.tmpfile @@ -0,0 +1 @@ +d /run/rspamd 0755 rspamd rspamd |