forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3.4.1-spamd.init-r2
38 lines (31 loc) · 1.15 KB
/
3.4.1-spamd.init-r2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/spamd"
pidfile="/run/spamd.pid"
command_args="--pidfile=${pidfile} ${SPAMD_OPTS}"
command_args_background="--daemonize"
if ! [ "${SPAMD_RUN_AS_ROOT}" = "true" ]; then
# Passing --username=root to spamd kills it, so if SPAMD_RUN_AS_ROOT
# is true, then we want to pass no user/group command args at all.
# Any value other than "true" gets the default user/group of "spamd".
command_args="${command_args} --username=spamd --groupname=spamd"
fi
: ${SPAMD_NICELEVEL:=0}
start_stop_daemon_args="--nicelevel ${SPAMD_NICELEVEL}"
# Retry after SPAMD_TIMEOUT seconds because spamd can take a
# while to kill off all of its children. This was bug 322025.
: ${SPAMD_TIMEOUT:=15}
retry="${SPAMD_TIMEOUT}"
extra_started_commands="reload"
depend() {
before mta
use logger mysql postgres
}
reload() {
ebegin "Reloading configuration"
# Warning: reload causes the PID of the spamd process to
# change, but spamd does update its PID file afterwards.
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}