aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rspamd/rspamd.initd
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2017-03-01 11:00:06 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-01 13:51:11 +0000
commitb79f05ecf3cff7abbbd7befcd97a9d06a37e0893 (patch)
tree4547f93614c2bc13da49fb8373e0f848f5e9330d /testing/rspamd/rspamd.initd
parent0ec529d41ef4db62104c2d7eda19a42dfe186b5e (diff)
downloadaports-b79f05ecf3cff7abbbd7befcd97a9d06a37e0893.tar.gz
aports-b79f05ecf3cff7abbbd7befcd97a9d06a37e0893.tar.bz2
aports-b79f05ecf3cff7abbbd7befcd97a9d06a37e0893.tar.xz
testing/rspamd: upgrade to 1.4.4
Diffstat (limited to 'testing/rspamd/rspamd.initd')
-rw-r--r--testing/rspamd/rspamd.initd31
1 files changed, 20 insertions, 11 deletions
diff --git a/testing/rspamd/rspamd.initd b/testing/rspamd/rspamd.initd
index 93148ccb4b..79e9d0d910 100644
--- a/testing/rspamd/rspamd.initd
+++ b/testing/rspamd/rspamd.initd
@@ -1,14 +1,19 @@
#!/sbin/openrc-run
description="Rapid spam filtering system"
-user=${user:-rspamd}
-group=${group:-rspamd}
-cfgfile=${cfgfile:-/etc/rspamd/rspamd.conf}
-pidfile=${pidfile:-/run/rspamd/rspamd.pid}
+
+: ${user:=${RSPAMD_USER:-rspamd}}
+: ${group:=${RSPAMD_GROUP:-rspamd}}
+: ${cfgdir:=${RSPAMD_CONFDIR:-/etc/rspamd}}
+: ${cfgfile:=${RSPAMD_CONFIG:-$cfgdir/rspamd.conf}}
+: ${pidfile:=${RSPAMD_PIDFILE:-/run/$RC_SVCNAME/rspamd.pid}}
+
command=/usr/sbin/rspamd
command_args="-u $user -g $group -c $cfgfile -p $pidfile"
required_files="$cfgfile"
+extra_commands="checkconfig"
extra_started_commands="reload reopen"
+description_checkconfig="Verify configuration"
description_reload="Reload configuration"
description_reopen="Reopen log files"
@@ -17,21 +22,25 @@ depend() {
before mta
}
-start_pre() {
- ebegin
- checkpath --directory --mode 750 --owner $user:$group ${pidfile%/*}
- $command $command_args -t >/dev/null 2>>${startuplog:-/dev/null}
+checkconfig() {
+ ebegin "Checking $RC_SVCNAME config"
+ $command $command_args -t
eend $?
}
+start_pre() {
+ checkpath -d -m 750 -o $user:$group ${pidfile%/*}
+ checkconfig >/dev/null 2>>${startuplog:=${RSPAMD_STARTUPLOG:-/dev/null}}
+}
+
reload() {
- ebegin "Reloading ${SVCNAME}"
- start-stop-daemon --signal HUP --pidfile $pidfile
+ ebegin "Reloading $RC_SVCNAME config"
+ checkconfig >/dev/null 2>&1 && start-stop-daemon --signal HUP --pidfile $pidfile
eend $?
}
reopen() {
- ebegin "Reopening ${SVCNAME} log files"
+ ebegin "Reopening $RC_SVCNAME log files"
start-stop-daemon --signal USR1 --pidfile $pidfile
eend $?
}