2015-02-27 00:58:55 +00:00
|
|
|
#!/sbin/runscript
|
|
|
|
# Copyright 1999-2013 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-16 17:20:11 +00:00
|
|
|
# $Id$
|
2015-02-27 00:58:55 +00:00
|
|
|
|
|
|
|
# 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}
|
|
|
|
|
|
|
|
extra_started_commands="reload"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
before mta
|
|
|
|
use logger
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting spamd"
|
|
|
|
start-stop-daemon --start --quiet \
|
|
|
|
--name spamd \
|
|
|
|
--nicelevel ${SPAMD_NICELEVEL:-0} \
|
|
|
|
--pidfile ${PIDFILE} \
|
|
|
|
--exec /usr/sbin/spamd -- -d -r ${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}
|
|
|
|
eend $? "Failed to stop spamd"
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
ebegin "Reloading configuration"
|
|
|
|
start-stop-daemon --signal HUP --quiet --pidfile ${PIDFILE}
|
|
|
|
eend $?
|
|
|
|
}
|