From: Frank Brehm Date: Wed, 28 Dec 2016 11:37:12 +0000 (+0100) Subject: saving uncommitted changes in /etc prior to emerge run X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=fe202ef63904ad6ccc88ec2e343066b688a1f4a1;p=config%2Fbruni%2Fetc.git saving uncommitted changes in /etc prior to emerge run --- diff --git a/conf.d/spamd b/conf.d/spamd index b3cd1acd..0cb7cbbf 100644 --- a/conf.d/spamd +++ b/conf.d/spamd @@ -1,46 +1,25 @@ # Config file for /etc/init.d/spamd - - +# # ***WARNING*** +# # spamd was not designed to listed to an untrusted network. spamd # is vulnerable to DoS attacks (and eternal doom) if used to listen # to an untrusted network. # - - -# Some options: -# -# -c to create a per user configuration file -# -H [dir] to switch home dirs for helper apps, dir optional -# -i [ip] to listen on the specified IP, -# 127.0.0.1 if omitted, -# 0.0.0.0 (ie. all) if given without value; -# must be used in combination with -A to actually allow -# connections from anybody but localhost -# -m limit to set the number of children, default 5 -# -u user the user to run spamd as -# -L if you want to run no net tests -# -# for more help look in man spamd -# -# Note: if you plan on using the -u flag to spamd you will need to -# make sure the location of the PID file is writable by that user. -# This can be done by making the directory /var/run/spamd and -# changing the owner to the UID that runs spamd. You will then -# need to edit $pidfile in /etc/init.d/spamd. This should fix the -# problem with stop/restart in the init scripts. +# ***WARNING*** # -# See http://bugs.gentoo.org/show_bug.cgi?id=70124 for a full -# explanation. - -SPAMD_OPTS="-m 5 -c -H" - -# spamd stores its pid in this file. If you use the -u option to -# run spamd under another user, you might need to adjust it. -PIDFILE="/run/spamd.pid" +# Additional options to pass to the spamd daemon. The spamd(1) man +# page explains the available options. If you choose to listen on a +# non-default interface, you will need to use OpenRC's "rc_need" +# mechanism to ensure that your interface comes up before spamd +# starts. The openrc-run(8) man page describes rc_need. +SPAMD_OPTS="--max-children=5 --create-prefs --helper-home-dir" -# SPAMD_NICELEVEL lets you set the 'nice'ness of the running -# spamd process +# Sets the 'nice' level of the spamd process. +SPAMD_NICELEVEL=0 -# SPAMD_NICELEVEL=5 +# How long (in seconds) should we wait for spamd to stop after we've +# asked it to? After this amount of time, if spamd is still running, +# we will assume that it has failed to stop. +SPAMD_TIMEOUT=15 diff --git a/init.d/spamd b/init.d/spamd index fa72229c..f27c2110 100755 --- a/init.d/spamd +++ b/init.d/spamd @@ -3,15 +3,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -# NB: Config is in /etc/conf.d/spamd - -# Provide a default location if they haven't in /etc/conf.d/spamd -PIDFILE=${PIDFILE:-/run/spamd.pid} +PIDDIR=/run/spamd +PIDFILE=${PIDDIR}/spamd.pid extra_started_commands="reload" depend() { - need net before mta use logger use postgresql @@ -20,27 +17,40 @@ depend() { start() { ebegin "Starting spamd" + + # Ensure that the PID file's directory exists. + checkpath --directory "${PIDDIR}" + + # Reloading spamd causes its PID to change, so we track it by + # name instead. start-stop-daemon --start --quiet \ --name spamd \ - --nicelevel ${SPAMD_NICELEVEL:-0} \ + --nicelevel ${SPAMD_NICELEVEL} \ --pidfile ${PIDFILE} \ - --exec /usr/sbin/spamd -- -d -r ${PIDFILE} \ - ${SPAMD_OPTS} + --exec /usr/sbin/spamd -- \ + --daemonize \ + --pidfile=${PIDFILE} \ + ${SPAMD_OPTS} + retval=$? - if ! [ -f "${PIDFILE}" ]; then - sleep 1 - fi + eend ${retval} "Failed to start spamd" } stop() { ebegin "Stopping spamd" - start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + # Retry after SPAMD_TIMEOUT seconds because spamd can take a + # while to kill off all of its children. This was bug 322025. + start-stop-daemon --stop \ + --quiet \ + --retry ${SPAMD_TIMEOUT} \ + --pidfile ${PIDFILE} eend $? "Failed to stop spamd" } reload() { ebegin "Reloading configuration" + # Warning: causes the PID of the spamd process to change. start-stop-daemon --signal HUP --quiet --pidfile ${PIDFILE} eend $? } diff --git a/mail/spamassassin/local.cf b/mail/spamassassin/local.cf index a40b217a..95bc4941 100644 --- a/mail/spamassassin/local.cf +++ b/mail/spamassassin/local.cf @@ -52,6 +52,11 @@ # bayes_ignore_header X-Spam-Status +# Whether to decode non- UTF-8 and non-ASCII textual parts and recode +# them to UTF-8 before the text is given over to rules processing. +# +# normalize_charset 1 + # Some shortcircuiting, if the plugin is enabled # ifplugin Mail::SpamAssassin::Plugin::Shortcircuit diff --git a/mail/spamassassin/v341.pre b/mail/spamassassin/v341.pre new file mode 100644 index 00000000..489dd4c3 --- /dev/null +++ b/mail/spamassassin/v341.pre @@ -0,0 +1,28 @@ +# This is the right place to customize your installation of SpamAssassin. +# +# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be +# tweaked. +# +# This file was installed during the installation of SpamAssassin 3.4.1, +# and contains plugin loading commands for the new plugins added in that +# release. It will not be overwritten during future SpamAssassin installs, +# so you can modify it to enable some disabled-by-default plugins below, +# if you so wish. +# +# There are now multiple files read to enable plugins in the +# /etc/mail/spamassassin directory; previously only one, "init.pre" was +# read. Now both "init.pre", "v310.pre", and any other files ending in +# ".pre" will be read. As future releases are made, new plugins will be +# added to new files, named according to the release they're added in. +########################################################################### + +# TxRep - Reputation database that replaces AWL +# loadplugin Mail::SpamAssassin::Plugin::TxRep + +# URILocalBL - Provides ISP and Country code based filtering as well as +# quick IP based blocks without a full RBL implementation - Bug 7060 + +# loadplugin Mail::SpamAssassin::Plugin::URILocalBL + +# PDFInfo - Use several methods to detect a PDF file's ham/spam traits +# loadplugin Mail::SpamAssassin::Plugin::PDFInfo