blob: 5b5f58e110b988a364cd4804d1758bd4d30081a6 (
plain)
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
49
50
51
52
53
54
55
56
|
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/files/init.d-nullmailer-r1,v 1.1 2012/06/05 13:48:55 eras Exp $
DAEMON="/usr/sbin/nullmailer-send"
ARGS="--daemon"
USER=nullmail
GROUP=nullmail
depend() {
need net logger
}
checkconfig() {
local error=0
local f=/etc/nullmailer/me
if [ ! -s ${f} ]; then
eerror "${f} does not exist"
error=1
fi
f=/etc/nullmailer/defaultdomain
if [ ! -s ${f} ]; then
eerror "${f} does not exist"
error=1
fi
if [ ${error} -eq 1 ]; then
einfo "You need to run 'emerge --config nullmailer'!"
fi
if [ -e /service/nullmailer ]; then
eerror "Nullmailer is already running under svscan!"
error=2
fi
if [ ${error} -ne 0 ]; then
return 1
else
return 0
fi
}
start() {
checkconfig
ebegin "Starting nullmailer"
cd /var/nullmailer
start-stop-daemon --start --quiet --user ${USER}:${GROUP} \
--exec ${DAEMON} -- ${ARGS}
eend $?
}
stop() {
checkconfig # to avoid init.d stopping svscan instance
ebegin "Stopping nullmailer"
cd /var/nullmailer
start-stop-daemon --stop --user ${USER} --exec ${DAEMON}
eend $?
}
|