forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initd.mailscanner
48 lines (41 loc) · 982 Bytes
/
initd.mailscanner
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
45
46
47
48
#!/sbin/openrc-run
opts="${opts} reload"
depend() {
need net mta
use logger dns
}
start() {
ebegin "Starting MailScanner"
#/usr/sbin/check_MailScanner >/dev/null
start-stop-daemon --start --pidfile /var/run/${SVCNAME}.pid \
--exec /usr/sbin/MailScanner -- /etc/MailScanner/MailScanner.conf ${OPT} > /var/run/${SVCNAME}.pid
eend $?
RETVAL=$?
[ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/MailScanner
[ ${RETVAL} -eq 0 ] && rm -f /var/lock/subsys/MailScanner.off
eend ${RETVAL}
}
stop() {
ebegin "Stopping MailScanner"
start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid
RETVAL=$?
[ ${RETVAL} -eq 0 ] && rm -f /var/lock/subsys/MailScanner
[ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/MailScanner.off
eend ${RETVAL}
}
reload() {
ebegin "Reloading MailScanner workers:"
pid=`pidof -x MailScanner`
if [ -n "$pid" ] ;
then
/bin/kill -HUP $pid
eend $?
else
eend 1
fi
}
restart() {
svc_stop
sleep ${RESTART_DELAY}
svc_start
}