1 |
eras 12/06/05 13:48:56 |
2 |
|
3 |
Added: init.d-nullmailer-r1 |
4 |
Log: |
5 |
Version bump. Change --chuid to --user in init script. Bugs #415417 #405529 |
6 |
|
7 |
(Portage version: 2.1.10.65/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 mail-mta/nullmailer/files/init.d-nullmailer-r1 |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/nullmailer/files/init.d-nullmailer-r1?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/nullmailer/files/init.d-nullmailer-r1?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: init.d-nullmailer-r1 |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2012 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License, v2 or later |
20 |
# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/files/init.d-nullmailer-r1,v 1.1 2012/06/05 13:48:55 eras Exp $ |
21 |
|
22 |
DAEMON="/usr/sbin/nullmailer-send" |
23 |
ARGS="--daemon" |
24 |
USER=nullmail |
25 |
GROUP=nullmail |
26 |
|
27 |
depend() { |
28 |
need net logger |
29 |
} |
30 |
|
31 |
checkconfig() { |
32 |
local error=0 |
33 |
local f=/etc/nullmailer/me |
34 |
if [ ! -s ${f} ]; then |
35 |
eerror "${f} does not exist" |
36 |
error=1 |
37 |
fi |
38 |
f=/etc/nullmailer/defaultdomain |
39 |
if [ ! -s ${f} ]; then |
40 |
eerror "${f} does not exist" |
41 |
error=1 |
42 |
fi |
43 |
if [ ${error} -eq 1 ]; then |
44 |
einfo "You need to run 'emerge --config nullmailer'!" |
45 |
fi |
46 |
if [ -e /service/nullmailer ]; then |
47 |
eerror "Nullmailer is already running under svscan!" |
48 |
error=2 |
49 |
fi |
50 |
if [ ${error} -ne 0 ]; then |
51 |
return 1 |
52 |
else |
53 |
return 0 |
54 |
fi |
55 |
} |
56 |
|
57 |
start() { |
58 |
checkconfig |
59 |
ebegin "Starting nullmailer" |
60 |
cd /var/nullmailer |
61 |
start-stop-daemon --start --quiet --user ${USER}:${GROUP} \ |
62 |
--exec ${DAEMON} -- ${ARGS} |
63 |
eend $? |
64 |
} |
65 |
|
66 |
stop() { |
67 |
checkconfig # to avoid init.d stopping svscan instance |
68 |
ebegin "Stopping nullmailer" |
69 |
cd /var/nullmailer |
70 |
start-stop-daemon --stop --user ${USER} --exec ${DAEMON} |
71 |
eend $? |
72 |
} |