rspamd/init
2017-07-23 19:36:36 +10:00

22 lines
421 B
Bash
Executable File

#!/bin/bash
set -e
NAME="RSPAMD"
function stop {
echo "Stopping ${NAME}"
kill $(cat /var/run/rspamd.pid)
kill $(cat /var/run/rmilter.pid)
}
trap 'stop' SIGTERM
if [ "$1" == "start" ]; then
[ -x /usr/bin/rspamd ] && /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid &
[ -x /usr/sbin/rmilter ] && /usr/sbin/rmilter -n -c /etc/rmilter/rmilter.conf &
wait
else
exec $@
fi