2009-03-03 16:56:10 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# PROVIDE: rspamd
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add the following line to /etc/rc.conf to enable countd:
|
|
|
|
# rspamd (bool): Set to "NO" by default.
|
|
|
|
# Set it to "YES" to enable rspamd.
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="rspamd"
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
procname="@CMAKE_INSTALL_PREFIX@/bin/rspamd"
|
2009-04-21 01:47:28 +02:00
|
|
|
restart_precmd="rspamd_checkconfig"
|
|
|
|
reload_precmd="rspamd_checkconfig"
|
|
|
|
configtest_cmd="rspamd_checkconfig"
|
2010-07-19 15:48:24 +02:00
|
|
|
reopenlog_cmd="reopenlog_cmd"
|
2009-03-03 16:56:10 +01:00
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
|
|
|
|
: ${rspamd_enable="NO"}
|
|
|
|
: ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"}
|
2010-10-28 15:27:47 +02:00
|
|
|
: ${rspamd_run_user="@RSPAMD_USER@"}
|
|
|
|
: ${rspamd_run_group="@RSPAMD_GROUP@"}
|
2009-03-03 16:56:10 +01:00
|
|
|
|
2009-09-24 13:31:48 +02:00
|
|
|
pidfile="$rspamd_pidfile"
|
|
|
|
|
2009-03-03 16:56:10 +01:00
|
|
|
stop_postcmd="rm -f $rspamd_pidfile"
|
|
|
|
|
2009-04-21 01:47:28 +02:00
|
|
|
rspamd_checkconfig()
|
|
|
|
{
|
|
|
|
echo "Performing sanity check on rspamd configuration:"
|
|
|
|
eval ${command} -t
|
|
|
|
}
|
|
|
|
|
2010-07-19 13:14:46 +02:00
|
|
|
reopenlog_cmd()
|
|
|
|
{
|
2010-07-20 16:11:32 +02:00
|
|
|
pkill -USR1 -F $rspamd_pidfile
|
2010-07-19 13:14:46 +02:00
|
|
|
}
|
|
|
|
|
2016-08-22 19:12:22 +02:00
|
|
|
extra_commands="reload configtest reopenlog"
|
2010-07-12 17:12:24 +02:00
|
|
|
sig_reload="HUP"
|
2009-03-03 16:56:10 +01:00
|
|
|
|
|
|
|
command="$procname"
|
2010-10-28 15:27:47 +02:00
|
|
|
command_args="-u ${rspamd_run_user} -g ${rspamd_run_group} -c @CMAKE_INSTALL_PREFIX@/etc/rspamd.xml"
|
2009-03-03 16:56:10 +01:00
|
|
|
|
|
|
|
run_rc_command "$1"
|