summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-06-04 11:13:03 -0400
committerMichael Orlitzky <mjo@gentoo.org>2016-06-04 11:29:57 -0400
commit19ff5b04b9db6b1319b35e9a6da3d26972bf04b5 (patch)
tree3372aa897cb40f52367dad180c31bfdd12017938 /mail-filter/spamassassin/files/3.4.1-spamd.init
parentwww-client/vivaldi: Version bump. (diff)
downloadgentoo-19ff5b04b9db6b1319b35e9a6da3d26972bf04b5.tar.gz
gentoo-19ff5b04b9db6b1319b35e9a6da3d26972bf04b5.tar.bz2
gentoo-19ff5b04b9db6b1319b35e9a6da3d26972bf04b5.zip
mail-filter/spamassassin: new revision with LibreSSL and spamd fixes.
This new revision adds another patch for upstream bugs 7093/7199. The sslv3 option for spamd didn't do what it was supposed to do, and moreover, it broke LibreSSL which no longer supports SSLv3. The patch removes the option and makes it an error. There is a simple fix for users, to remove the --ssl-version option if they are using it. Thanks to Reuben Farrelly for reporting the issue. The second round of changes addresses a few old Gentoo bugs regarding the spamd init scripts and configuration. First, the init script was missing a call to "checkpath" to ensure that the PID file had some place to live. That's now fixed. Second, it used to be the case that some configuration was necessary if you opted to run spamd as a non-root user. That is no longer the case, so all of the documentation surrounding that issue has been removed, and the config/init scripts greatly simplified. Finally, a SPAMD_TIMEOUT option was added to allow spamd a little bit of time when restarting or shutting down. Peter Gantner, Juan David Ibáñez Palomar, Marcin Mirosław, Frieder Bürzele, and a few other people helped out on those bugs. Thanks! Gentoo-Bug: 322025 Gentoo-Bug: 455604 Gentoo-Bug: 523960 Upstream-Bug: 7093 Upstream-Bug: 7199 Package-Manager: portage-2.2.28
Diffstat (limited to 'mail-filter/spamassassin/files/3.4.1-spamd.init')
-rw-r--r--mail-filter/spamassassin/files/3.4.1-spamd.init56
1 files changed, 56 insertions, 0 deletions
diff --git a/mail-filter/spamassassin/files/3.4.1-spamd.init b/mail-filter/spamassassin/files/3.4.1-spamd.init
new file mode 100644
index 00000000000..7d2af814a03
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.4.1-spamd.init
@@ -0,0 +1,56 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PIDDIR=/run/spamd
+PIDFILE=${PIDDIR}/spamd.pid
+
+extra_started_commands="reload"
+
+depend() {
+ before mta
+ use logger
+@USEPOSTGRES@ use postgresql
+@USEMYSQL@ use mysql
+}
+
+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} \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/spamd -- \
+ --daemonize \
+ --pidfile=${PIDFILE} \
+ ${SPAMD_OPTS}
+
+ retval=$?
+
+ eend ${retval} "Failed to start spamd"
+}
+
+stop() {
+ ebegin "Stopping spamd"
+ # 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 $?
+}