#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/files/dspam.rc,v 1.1 2005/03/21 00:10:30 st_lim Exp $ depend() { use logger need net before mta after pg_autovacuum postgresql mysql } checkconfig() { if [ ! -f "/etc/mail/dspam/dspam.conf" ] then eerror "You need a DSPAM configuration in /etc/mail/dspam/dspam.conf" return 1 fi if (! grep -q "^ServerPID" /etc/mail/dspam/dspam.conf); then eerror "ServerPID missing in DSPAM configuration /etc/mail/dspam/dspam.conf" return 1 fi } start() { checkconfig || return 1 ebegin "Starting DSPAM" start-stop-daemon --start --quiet --background -c dspam:dspam \ --exec /usr/bin/dspam -- --daemon eend ${?} } stop() { checkconfig || return 1 local DSPAM_PID="$(grep "^ServerPID" /etc/mail/dspam/dspam.conf)" DSPAM_PID="${DSPAM_PID/ServerPID/}" ebegin "Stopping DSPAM" start-stop-daemon --user dspam --group dspam --stop --quiet --pidfile ${DSPAM_PID} eend ${?} }