aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rspamd/rspamd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/rspamd/rspamd.initd')
-rw-r--r--testing/rspamd/rspamd.initd29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/rspamd/rspamd.initd b/testing/rspamd/rspamd.initd
new file mode 100644
index 0000000000..5189e49348
--- /dev/null
+++ b/testing/rspamd/rspamd.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+
+description="Rapid spam filtering system"
+command="/usr/sbin/rspamd"
+command_args="-u rspamd -g rspamd"
+cfgfile=${cfgfile:-/etc/rspamd/rspamd.conf}
+pidfile="/run/rspamd/rspamd.pid"
+required_files="$cfgfile"
+extra_started_commands="reload"
+description_reload="Reload configuration"
+
+depend() {
+ need localmount net
+ before exim postfix
+}
+
+start_pre() {
+ ebegin
+ [ "$cfgfile" = "/etc/rspamd/rspamd.conf" ] || command_args="$command_args -c $cfgfile"
+ checkpath --directory --mode 750 --owner rspamd:rspamd "${pidfile%/*}"
+ $command $command_args -t &>/dev/null
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile ${pidfile}
+ eend $?
+}