summaryrefslogtreecommitdiffstats
path: root/freebsd/rspamd.sh.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 21:30:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 21:30:40 +0000
commit133a45c109da5310add55824db21af5239951f93 (patch)
treeba6ac4c0a950a0dda56451944315d66409923918 /freebsd/rspamd.sh.in
parentInitial commit. (diff)
downloadrspamd-133a45c109da5310add55824db21af5239951f93.tar.xz
rspamd-133a45c109da5310add55824db21af5239951f93.zip
Adding upstream version 3.8.1.upstream/3.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'freebsd/rspamd.sh.in')
-rwxr-xr-xfreebsd/rspamd.sh.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/freebsd/rspamd.sh.in b/freebsd/rspamd.sh.in
new file mode 100755
index 0000000..c527a6d
--- /dev/null
+++ b/freebsd/rspamd.sh.in
@@ -0,0 +1,52 @@
+#!/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"
+restart_precmd="rspamd_checkconfig"
+reload_precmd="rspamd_checkconfig"
+configtest_cmd="rspamd_checkconfig"
+reopenlog_cmd="reopenlog_cmd"
+
+load_rc_config $name
+
+: ${rspamd_enable="NO"}
+: ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"}
+: ${rspamd_run_user="@RSPAMD_USER@"}
+: ${rspamd_run_group="@RSPAMD_GROUP@"}
+
+pidfile="$rspamd_pidfile"
+
+stop_postcmd="rm -f $rspamd_pidfile"
+
+rspamd_checkconfig()
+{
+ echo "Performing sanity check on rspamd configuration:"
+ eval ${command} -t
+}
+
+reopenlog_cmd()
+{
+ pkill -USR1 -F $rspamd_pidfile
+}
+
+extra_commands="reload configtest reopenlog"
+sig_reload="HUP"
+
+command="$procname"
+command_args="-u ${rspamd_run_user} -g ${rspamd_run_group} -c @CMAKE_INSTALL_PREFIX@/etc/rspamd.xml"
+
+run_rc_command "$1"