|
Lines 1-6
Link Here
|
| 1 |
--- examples/init-script.in.orig 2017-09-07 17:52:24 UTC |
1 |
--- examples/init-script.in.orig 2017-09-07 17:52:24 UTC |
| 2 |
+++ examples/init-script.in |
2 |
+++ examples/init-script.in |
| 3 |
@@ -41,6 +41,12 @@ export LC_ALL |
3 |
@@ -7,6 +7,14 @@ |
|
|
4 |
# BEFORE: mail |
| 5 |
# KEYWORD: shutdown |
| 6 |
|
| 7 |
+. /etc/rc.subr |
| 8 |
+ |
| 9 |
+# read settings, set default values |
| 10 |
+load_rc_config "$name" |
| 11 |
+ |
| 12 |
+: ${mimedefang_mx_max_rss=100000} |
| 13 |
+: ${mimedefang_mx_max_as=300000} |
| 14 |
+ |
| 15 |
RETVAL=0 |
| 16 |
prog='mimedefang' |
| 17 |
SPOOLDIR='@SPOOLDIR@' |
| 18 |
@@ -41,6 +49,12 @@ export LC_ALL |
| 4 |
# The socket used by mimedefang to communicate with sendmail |
19 |
# The socket used by mimedefang to communicate with sendmail |
| 5 |
# SOCKET=$SPOOLDIR/mimedefang.sock |
20 |
# SOCKET=$SPOOLDIR/mimedefang.sock |
| 6 |
|
21 |
|
|
Lines 13-33
Link Here
|
| 13 |
# Run the multiplexor and filters as this user, not root. RECOMMENDED |
28 |
# Run the multiplexor and filters as this user, not root. RECOMMENDED |
| 14 |
MX_USER=@DEFANGUSER@ |
29 |
MX_USER=@DEFANGUSER@ |
| 15 |
|
30 |
|
| 16 |
@@ -138,11 +144,11 @@ MX_MAXIMUM=10 |
31 |
@@ -138,11 +152,11 @@ MX_MAXIMUM=10 |
| 17 |
|
32 |
|
| 18 |
# Limit worker processes' resident-set size to this many kilobytes. Default |
33 |
# Limit worker processes' resident-set size to this many kilobytes. Default |
| 19 |
# is unlimited. |
34 |
# is unlimited. |
| 20 |
-# MX_MAX_RSS=10000 |
35 |
-# MX_MAX_RSS=10000 |
| 21 |
+MX_MAX_RSS=100000 |
36 |
+MX_MAX_RSS=${mimedefang_mx_max_rss} |
| 22 |
|
37 |
|
| 23 |
# Limit total size of worker processes' memory space to this many kilobytes. |
38 |
# Limit total size of worker processes' memory space to this many kilobytes. |
| 24 |
# Default is unlimited. |
39 |
# Default is unlimited. |
| 25 |
-# MX_MAX_AS=30000 |
40 |
-# MX_MAX_AS=30000 |
| 26 |
+MX_MAX_AS=300000 |
41 |
+MX_MAX_AS=${mimedefang_mx_max_as} |
| 27 |
|
42 |
|
| 28 |
# If you want to use the "notification" facility, set the appropriate port. |
43 |
# If you want to use the "notification" facility, set the appropriate port. |
| 29 |
# See the mimedefang-notify man page for details. |
44 |
# See the mimedefang-notify man page for details. |
| 30 |
@@ -189,7 +195,7 @@ then |
45 |
@@ -189,7 +203,7 @@ then |
| 31 |
. /etc/rc.subr |
46 |
. /etc/rc.subr |
| 32 |
|
47 |
|
| 33 |
name=$prog |
48 |
name=$prog |
|
Lines 36-42
Link Here
|
| 36 |
# default to not enabled, enable in rc.conf |
51 |
# default to not enabled, enable in rc.conf |
| 37 |
eval $rcvar=\${$rcvar:-NO} |
52 |
eval $rcvar=\${$rcvar:-NO} |
| 38 |
|
53 |
|
| 39 |
@@ -199,6 +205,7 @@ then |
54 |
@@ -199,6 +213,7 @@ then |
| 40 |
procname=$PROGDIR/$prog-multiplexor |
55 |
procname=$PROGDIR/$prog-multiplexor |
| 41 |
start_cmd="start_it" |
56 |
start_cmd="start_it" |
| 42 |
stop_cmd="stop_it" |
57 |
stop_cmd="stop_it" |
|
Lines 44-50
Link Here
|
| 44 |
sig_reload="INT" |
59 |
sig_reload="INT" |
| 45 |
reread_cmd="reread_it" |
60 |
reread_cmd="reread_it" |
| 46 |
# provide both "reload", the FreeBSD default, with a direct signal to |
61 |
# provide both "reload", the FreeBSD default, with a direct signal to |
| 47 |
@@ -209,6 +216,8 @@ fi |
62 |
@@ -209,6 +224,8 @@ fi |
| 48 |
# Make sure required vars are set |
63 |
# Make sure required vars are set |
| 49 |
SOCKET=${SOCKET:=$SPOOLDIR/$prog.sock} |
64 |
SOCKET=${SOCKET:=$SPOOLDIR/$prog.sock} |
| 50 |
MX_SOCKET=${MX_SOCKET:=$SPOOLDIR/$prog-multiplexor.sock} |
65 |
MX_SOCKET=${MX_SOCKET:=$SPOOLDIR/$prog-multiplexor.sock} |
|
Lines 53-59
Link Here
|
| 53 |
|
68 |
|
| 54 |
start_it() { |
69 |
start_it() { |
| 55 |
if test -r $PID ; then |
70 |
if test -r $PID ; then |
| 56 |
@@ -294,6 +303,29 @@ start_it() { |
71 |
@@ -294,6 +311,29 @@ start_it() { |
| 57 |
kill `cat $MXPID` |
72 |
kill `cat $MXPID` |
| 58 |
return 1 |
73 |
return 1 |
| 59 |
fi |
74 |
fi |
|
Lines 83-89
Link Here
|
| 83 |
return 0 |
98 |
return 0 |
| 84 |
} |
99 |
} |
| 85 |
|
100 |
|
| 86 |
@@ -329,7 +361,7 @@ stop_it() { |
101 |
@@ -329,7 +369,7 @@ stop_it() { |
| 87 |
rm -f $MX_SOCKET > /dev/null 2>&1 |
102 |
rm -f $MX_SOCKET > /dev/null 2>&1 |
| 88 |
rm -f $SOCKET > /dev/null 2>&1 |
103 |
rm -f $SOCKET > /dev/null 2>&1 |
| 89 |
|
104 |
|
|
Lines 92-107
Link Here
|
| 92 |
printf "Waiting for daemons to exit." |
107 |
printf "Waiting for daemons to exit." |
| 93 |
WAITPID="" |
108 |
WAITPID="" |
| 94 |
test -f $PID && WAITPID=`cat $PID` |
109 |
test -f $PID && WAITPID=`cat $PID` |
| 95 |
@@ -381,6 +413,12 @@ reread_it() { |
110 |
@@ -379,6 +419,12 @@ reread_it() { |
|
|
111 |
echo "Could not find process-ID of $prog-multiplexor" |
| 112 |
fi |
| 96 |
fi |
113 |
fi |
| 97 |
} |
114 |
+} |
| 98 |
|
115 |
+ |
| 99 |
+restart_it() { |
116 |
+restart_it() { |
| 100 |
+ stop_it wait |
117 |
+ stop_it wait |
| 101 |
+ start_it |
118 |
+ start_it |
| 102 |
+ RETVAL=$? |
119 |
+ RETVAL=$? |
| 103 |
+} |
120 |
} |
| 104 |
+ |
121 |
|
| 105 |
if type run_rc_command > /dev/null 2>&1 |
122 |
if type run_rc_command > /dev/null 2>&1 |
| 106 |
then |
|
|
| 107 |
# NetBSD/FreeBSD compatible startup script |