rspamd/init

22 lines
421 B
Plaintext
Raw Normal View History

2017-07-23 09:36:36 +00:00
#!/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