Lines 17-30
Link Here
|
17 |
|
17 |
|
18 |
command=%%PREFIX%%/sbin/${name}.pl |
18 |
command=%%PREFIX%%/sbin/${name}.pl |
19 |
command_args='> /dev/null 2>&1' |
19 |
command_args='> /dev/null 2>&1' |
20 |
command_interpreter=/usr/bin/perl |
20 |
command_interpreter=%%PERL%% |
21 |
start_precmd=start_precmd |
21 |
start_precmd=start_precmd |
22 |
stop_postcmd=stop_postcmd |
22 |
stop_postcmd=stop_postcmd |
23 |
|
23 |
|
24 |
start_precmd() |
24 |
start_precmd() |
25 |
{ |
25 |
{ |
26 |
mkdir -p "%%DATADIR%%" |
26 |
mkdir -p "$mailgraph_chdir" |
27 |
chown "%%MAILGRAPH_USER%%" "%%DATADIR%%" |
27 |
chown "$mailgraph_user" "$mailgraph_chdir" |
|
|
28 |
if ! su -m $mailgraph_user -c 'sh -c "[ -r '$mailgraph_maillog' ]"'; then |
29 |
echo "MAILGRAPH CANNOT RUN: $mailgraph_maillog not readable by $mailgraph_user" |
30 |
return 1 |
31 |
fi |
28 |
} |
32 |
} |
29 |
|
33 |
|
30 |
stop_postcmd() |
34 |
stop_postcmd() |
Lines 35-44
Link Here
|
35 |
load_rc_config $name |
39 |
load_rc_config $name |
36 |
|
40 |
|
37 |
: ${mailgraph_enable="NO"} |
41 |
: ${mailgraph_enable="NO"} |
38 |
: ${mailgraph_pidfile="%%DATADIR%%/mailgraph.pid"} |
42 |
: ${mailgraph_chdir="%%DATADIR%%"} |
39 |
: ${mailgraph_flags="--logfile /var/log/maillog --daemon-rrd=%%DATADIR%% --ignore-localhost --daemon --daemon-pid=${mailgraph_pidfile}"} |
43 |
: ${mailgraph_pidfile="$mailgraph_chdir/mailgraph.pid"} |
|
|
44 |
: ${mailgraph_maillog="/var/log/maillog"} |
45 |
: ${mailgraph_flags="--logfile $mailgraph_maillog --daemon-rrd=$mailgraph_chdir --ignore-localhost --daemon --daemon-pid=$mailgraph_pidfile"} |
40 |
: ${mailgraph_user="%%MAILGRAPH_USER%%"} |
46 |
: ${mailgraph_user="%%MAILGRAPH_USER%%"} |
41 |
: ${mailgraph_chdir="%%DATADIR%%"} |
|
|
42 |
|
47 |
|
43 |
pidfile=${mailgraph_pidfile} |
48 |
pidfile=${mailgraph_pidfile} |
44 |
|
49 |
|