diff options
author | TBK <tbk@jjtc.dk> | 2017-10-04 12:46:48 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-10-09 15:50:54 +0000 |
commit | dd017b00960cc4c64788a3092d0b444eb592f341 (patch) | |
tree | 48da30cfb6dece02953f2b5f90c6fcdc29bd1135 /community/rspamd/rspamd.initd | |
parent | 0c2b89fb9b8889b59e0ff8e73182280894967e29 (diff) | |
download | aports-dd017b00960cc4c64788a3092d0b444eb592f341.tar.bz2 aports-dd017b00960cc4c64788a3092d0b444eb592f341.tar.xz |
community/rspamd: move from testing
Diffstat (limited to 'community/rspamd/rspamd.initd')
-rw-r--r-- | community/rspamd/rspamd.initd | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/community/rspamd/rspamd.initd b/community/rspamd/rspamd.initd new file mode 100644 index 0000000000..79e9d0d910 --- /dev/null +++ b/community/rspamd/rspamd.initd @@ -0,0 +1,46 @@ +#!/sbin/openrc-run + +description="Rapid spam filtering system" + +: ${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" + +depend() { + need localmount net + before mta +} + +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 $RC_SVCNAME config" + checkconfig >/dev/null 2>&1 && start-stop-daemon --signal HUP --pidfile $pidfile + eend $? +} + +reopen() { + ebegin "Reopening $RC_SVCNAME log files" + start-stop-daemon --signal USR1 --pidfile $pidfile + eend $? +} |