aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rspamd/rspamd.initd
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2016-01-21 15:10:55 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-01-21 15:06:48 +0000
commitba41dc3379acd5b01c1c7cb9989f892eceec803e (patch)
treef8bb7df1cdd0d56db2237555749992ed2d7f70e2 /testing/rspamd/rspamd.initd
parent7cd2e6e513a54234027793ec1560498e2f35263d (diff)
downloadaports-ba41dc3379acd5b01c1c7cb9989f892eceec803e.tar.gz
aports-ba41dc3379acd5b01c1c7cb9989f892eceec803e.tar.bz2
aports-ba41dc3379acd5b01c1c7cb9989f892eceec803e.tar.xz
testing/rspamd: cleaning and refining after initial commit
Diffstat (limited to 'testing/rspamd/rspamd.initd')
-rw-r--r--testing/rspamd/rspamd.initd15
1 files changed, 8 insertions, 7 deletions
diff --git a/testing/rspamd/rspamd.initd b/testing/rspamd/rspamd.initd
index 5189e49348..0fd5b9323b 100644
--- a/testing/rspamd/rspamd.initd
+++ b/testing/rspamd/rspamd.initd
@@ -1,10 +1,12 @@
#!/sbin/openrc-run
description="Rapid spam filtering system"
-command="/usr/sbin/rspamd"
-command_args="-u rspamd -g rspamd"
+user=${user:-rspamd}
+group=${group:-rspamd}
cfgfile=${cfgfile:-/etc/rspamd/rspamd.conf}
-pidfile="/run/rspamd/rspamd.pid"
+pidfile=${pidfile:-/run/rspamd/rspamd.pid}
+command=/usr/sbin/rspamd
+command_args="-u $user -g $group -c $cfgfile -p $pidfile"
required_files="$cfgfile"
extra_started_commands="reload"
description_reload="Reload configuration"
@@ -16,14 +18,13 @@ depend() {
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
+ checkpath --directory --mode 750 --owner $user:$group ${pidfile%/*}
+ $command $command_args -t >/dev/null 2>>${startuplog:-/dev/null}
eend $?
}
reload() {
ebegin "Reloading ${SVCNAME}"
- start-stop-daemon --signal HUP --pidfile ${pidfile}
+ start-stop-daemon --signal HUP --pidfile $pidfile
eend $?
}