forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dspam.initd
44 lines (38 loc) · 867 Bytes
/
dspam.initd
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
39
40
41
42
43
44
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_started_commands="reload"
PIDFILE=${PID_FILE:-/var/run/dspam/dspam.pid}
depend() {
use logger
before mta
after postgresql mysql ldap
}
checkconfig() {
local PIDDIR
PIDDIR=${PIDFILE%/*}
if [ ! -d "${PIDDIR:-/var/run/dspam}" ]; then
checkpath -q -d -o dspam:dspam -m 0755 "${PIDDIR}" || return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting dspam"
start-stop-daemon --start --quiet \
--user ${DAEMON_USER_GROUP} \
--pidfile ${PIDFILE} \
--exec /usr/bin/dspam -- --daemon
eend $?
}
stop() {
ebegin "Stopping dspam"
start-stop-daemon --stop \
--pidfile ${PIDFILE} \
--exec /usr/bin/dspam
eend $?
}
reload() {
ebegin "Reloading dspam"
start-stop-daemon --signal SIGHUP /usr/bin/dspam
eend $?
}