Lines 10-15
Link Here
|
10 |
# Set it to "YES" to enable mailscanner |
10 |
# Set it to "YES" to enable mailscanner |
11 |
# mailscanner_configfile (path): Set to "%%PREFIX%%/etc/MailScanner/MailScanner.conf" by default. |
11 |
# mailscanner_configfile (path): Set to "%%PREFIX%%/etc/MailScanner/MailScanner.conf" by default. |
12 |
# mailscanner_pidfile (path): Set to "/var/run/MailScanner.pid" by default. |
12 |
# mailscanner_pidfile (path): Set to "/var/run/MailScanner.pid" by default. |
|
|
13 |
# mailscanner_user (str): Set to "root" by default. If you changed the "Run As User" variable in MailScanner.conf you MUST also set the same value here. |
13 |
# |
14 |
# |
14 |
|
15 |
|
15 |
. %%RC_SUBR%% |
16 |
. %%RC_SUBR%% |
Lines 22-43
Link Here
|
22 |
: ${mailscanner_enable="NO"} |
23 |
: ${mailscanner_enable="NO"} |
23 |
: ${mailscanner_configfile="%%PREFIX%%/etc/MailScanner/MailScanner.conf"} |
24 |
: ${mailscanner_configfile="%%PREFIX%%/etc/MailScanner/MailScanner.conf"} |
24 |
: ${mailscanner_pidfile="/var/run/MailScanner.pid"} |
25 |
: ${mailscanner_pidfile="/var/run/MailScanner.pid"} |
|
|
26 |
: ${mailscanner_user="root"} |
25 |
|
27 |
|
26 |
command="%%PREFIX%%/sbin/mailscanner" |
28 |
command="%%PREFIX%%/sbin/mailscanner" |
27 |
pidfile=${mailscanner_pidfile} |
29 |
pidfile=${mailscanner_pidfile} |
28 |
command_args="${mailscanner_configfile}" |
30 |
command_args="${mailscanner_configfile}" |
|
|
31 |
procname="MailScanner" |
29 |
|
32 |
|
30 |
required_files="${mailscanner_configfile}" |
33 |
required_files="${mailscanner_configfile}" |
31 |
|
34 |
|
32 |
_ms_start_precmd() { |
35 |
start_precmd=pid_touch |
33 |
# Quietly try to raise the open_files limit |
36 |
start_cmd="mailscanner_start" |
34 |
# |
|
|
35 |
ulimit -n 2000 >/dev/null 2>&1 |
36 |
} |
37 |
|
37 |
|
38 |
start_precmd=_ms_start_precmd |
38 |
pid_touch () |
|
|
39 |
{ |
40 |
touch $mailscanner_pidfile |
41 |
chown $mailscanner_user $mailscanner_pidfile |
42 |
} |
39 |
|
43 |
|
40 |
procname="MailScanner" |
44 |
mailscanner_start() { |
|
|
45 |
su -m ${mailscanner_user} -c "exec ${command} ${command_args}" |
46 |
} |
41 |
|
47 |
|
42 |
run_rc_command "$1" |
48 |
run_rc_command "$1" |
43 |
|
49 |
|