mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-26 08:51:25 +02:00
This directory is used for pid file and sockets. User can specify desired permissions for each socket in rspamd config. Creating /run/rspamd with perms 750 is just an obstacle when user needs to make some of the sockets accessible for anyone.
55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
#!/sbin/openrc-run
|
|
|
|
extra_commands="checkconfig"
|
|
extra_started_commands="reload reopen"
|
|
|
|
description="Rapid spam filtering system"
|
|
description_checkconfig="Check configuration"
|
|
description_reload="Reload configuration"
|
|
description_reopen="Reopen log files"
|
|
|
|
# Uppercase variables are here for backward compatibility only.
|
|
: ${command_user:="${RSPAMD_USER:-rspamd}:${RSPAMD_GROUP:-rspamd}"}
|
|
: ${cfgfile:=${RSPAMD_CONFIG:-/etc/rspamd/rspamd.conf}}
|
|
: ${startuplog:=${RSPAMD_STARTUPLOG:-/dev/null}}
|
|
|
|
command="/usr/sbin/rspamd"
|
|
command_args="--config $cfgfile --no-fork ${command_args:-}"
|
|
command_background="yes"
|
|
pidfile="/run/rspamd/$RC_SVCNAME.pid"
|
|
|
|
required_files="$cfgfile"
|
|
|
|
depend() {
|
|
need localmount net
|
|
before mta
|
|
after redis
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -d -m 755 -o "$command_user" ${pidfile%/*}
|
|
checkconfig >/dev/null 2>>"$startuplog" || checkconfig
|
|
}
|
|
|
|
checkconfig() {
|
|
ebegin "Checking $name configuration"
|
|
|
|
$command $command_args \
|
|
-u "${command_user%:*}" \
|
|
-g "${command_user#*:}" \
|
|
--config-test
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $name configuration"
|
|
start_pre && start-stop-daemon --signal HUP --pidfile $pidfile
|
|
eend $?
|
|
}
|
|
|
|
reopen() {
|
|
ebegin "Reopening $name log files"
|
|
start-stop-daemon --signal USR1 --pidfile $pidfile
|
|
eend $?
|
|
}
|