1 |
slords |
1.1 |
#! /bin/bash |
2 |
|
|
# |
3 |
|
|
# qpsmtpd-forkserver Start/Stop the qpsmtpd forking server |
4 |
|
|
# |
5 |
|
|
# chkconfig: 2345 90 60 |
6 |
|
|
# description: qpsmtpd is a flexible smtpd daemon written in Perl. \ |
7 |
|
|
# Apart from the core SMTP features, all functionality is \ |
8 |
|
|
# implemented in small "extension plugins" using the easy \ |
9 |
|
|
# to use object oriented plugin API. |
10 |
|
|
# processname: qpsmtpd-forkserver |
11 |
|
|
# config: /etc/qpsmtpd |
12 |
|
|
# pidfile: /var/run/qpsmtpd-forkserver.pid |
13 |
|
|
|
14 |
|
|
# Source function library. |
15 |
|
|
. /etc/init.d/functions |
16 |
|
|
. /etc/sysconfig/qpsmtpd-forkserver |
17 |
|
|
|
18 |
|
|
RETVAL=0 |
19 |
|
|
|
20 |
|
|
# See how we were called. |
21 |
|
|
|
22 |
|
|
prog="qpsmtpd-forkserver" |
23 |
|
|
|
24 |
|
|
start() { |
25 |
|
|
echo -n $"Starting $prog: " |
26 |
|
|
trap "" 1 |
27 |
|
|
nohup qpsmtpd-forkserver $QPSMTPD_OPTIONS 2>&1 | |
28 |
|
|
/usr/local/bin/ts $TS_OPTIONS & |
29 |
|
|
RETVAL=$? |
30 |
|
|
echo |
31 |
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/qpsmtpd-forkserver |
32 |
|
|
return $RETVAL |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
stop() { |
36 |
|
|
echo -n $"Stopping $prog: " |
37 |
|
|
killproc qpsmtpd-forkserver |
38 |
|
|
RETVAL=$? |
39 |
|
|
echo |
40 |
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/qpsmtpd-forkserver |
41 |
|
|
return $RETVAL |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
rhstatus() { |
45 |
|
|
status qpsmtpd-forkserver |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
restart() { |
49 |
|
|
stop |
50 |
|
|
start |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
reload() { |
54 |
|
|
stop |
55 |
|
|
start |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
case "$1" in |
59 |
|
|
start) |
60 |
|
|
start |
61 |
|
|
;; |
62 |
|
|
stop) |
63 |
|
|
stop |
64 |
|
|
;; |
65 |
|
|
restart) |
66 |
|
|
restart |
67 |
|
|
;; |
68 |
|
|
reload) |
69 |
|
|
reload |
70 |
|
|
;; |
71 |
|
|
status) |
72 |
|
|
rhstatus |
73 |
|
|
;; |
74 |
|
|
condrestart) |
75 |
|
|
[ -f /var/lock/subsys/qpsmtpd-forkserver ] && restart || : |
76 |
|
|
;; |
77 |
|
|
*) |
78 |
|
|
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" |
79 |
|
|
exit 1 |
80 |
|
|
esac |
81 |
|
|
|
82 |
|
|
exit $? |