summaryrefslogtreecommitdiff
path: root/mail-filter/dspam/files/dspam.initd
diff options
context:
space:
mode:
Diffstat (limited to 'mail-filter/dspam/files/dspam.initd')
-rw-r--r--mail-filter/dspam/files/dspam.initd45
1 files changed, 45 insertions, 0 deletions
diff --git a/mail-filter/dspam/files/dspam.initd b/mail-filter/dspam/files/dspam.initd
new file mode 100644
index 00000000000..4e8acf60ec8
--- /dev/null
+++ b/mail-filter/dspam/files/dspam.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+PIDFILE=${PID_FILE:-/var/run/dspam/dspam.pid}
+
+depend() {
+ use logger
+ before mta
+ after postgresql mysql ldap
+}
+
+checkconfig() {
+ local PIDDIR
+ PIDDIR=${PIDFILE%/*}
+ if [ ! -d "${PIDDIR:-/var/run/dspam}" ]; then
+ checkpath -q -d -o dspam:dspam -m 0755 "${PIDDIR}" || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting dspam"
+ start-stop-daemon --start --quiet \
+ --user ${DAEMON_USER_GROUP} \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/dspam -- --daemon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dspam"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/dspam
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading dspam"
+ start-stop-daemon --signal SIGHUP /usr/bin/dspam
+ eend $?
+}