Lines 12-46
Link Here
|
12 |
# to enable this service: |
12 |
# to enable this service: |
13 |
# |
13 |
# |
14 |
#syslog_ng_enable="YES" |
14 |
#syslog_ng_enable="YES" |
15 |
#syslog_ng_config="-u daemon" |
15 |
#syslog_ng_flags="-u daemon" |
16 |
#syslog_ng_pid="/var/run/syslog-ng.pid" |
16 |
#syslog_ng_pidfile="/var/run/syslog-ng.pid" |
17 |
# |
17 |
# |
18 |
|
18 |
|
19 |
syslog_ng_purgeklog=${syslog_ng_purgeklog-"NO"} |
|
|
20 |
|
21 |
. /etc/rc.subr |
19 |
. /etc/rc.subr |
22 |
|
20 |
|
23 |
name=syslog_ng |
21 |
name=syslog_ng |
24 |
rcvar=syslog_ng_enable |
22 |
rcvar=syslog_ng_enable |
25 |
|
23 |
|
26 |
command=%%PREFIX%%/sbin/syslog-ng |
24 |
load_rc_config $name |
27 |
required_files=%%PREFIX%%/etc/syslog-ng.conf |
|
|
28 |
extra_commands=reload |
29 |
|
25 |
|
|
|
26 |
: ${syslog_ng_enable:="NO"} |
27 |
: ${syslog_ng_purgeklog:="NO"} |
28 |
: ${syslog_ng_config:="%%PREFIX%%/etc/syslog-ng.conf"} |
29 |
: ${syslog_ng_pidfile:=/var/run/syslog.pid} |
30 |
|
31 |
# backwards compatibility |
32 |
if [ -n "${syslog_ng_pid}" ]; then |
33 |
syslog_ng_pidfile="${syslog_ng_pid}" |
34 |
fi |
35 |
if [ ! -f "${syslog_ng_config}" ]; then |
36 |
syslog_ng_flags="${syslog_ng_config}" |
37 |
syslog_ng_config="%%PREFIX%%/etc/syslog-ng.conf" |
38 |
fi |
39 |
|
30 |
if checkyesno syslog_ng_purgeklog; then |
40 |
if checkyesno syslog_ng_purgeklog; then |
31 |
start_precmd="echo \"Purging klog(9)\" && sysctl -w kern.msgbuf_clear=1 $start_precmd"; |
41 |
start_precmd="echo \"Purging klog(9)\" && sysctl -w kern.msgbuf_clear=1" |
32 |
fi |
42 |
fi |
33 |
|
43 |
|
34 |
stop_postcmd=stop_postcmd |
44 |
pidfile="${syslog_ng_pidfile}" |
|
|
45 |
required_files="${syslog_ng_config}" |
35 |
|
46 |
|
36 |
load_rc_config $name |
47 |
command="%%PREFIX%%/sbin/syslog-ng" |
|
|
48 |
command_args="-f ${syslog_ng_config} -p ${pidfile}" |
37 |
|
49 |
|
38 |
: ${syslog_ng_enable:="NO"} |
50 |
stop_postcmd="stop_postcmd" |
39 |
pidfile=${syslog_ng_pid:-"/var/run/syslog.pid"} |
51 |
extra_commands="reload" |
40 |
command_args="-p ${pidfile} ${syslog_ng_config}" |
|
|
41 |
|
52 |
|
42 |
stop_postcmd() { |
53 |
stop_postcmd() |
43 |
rm -f $pidfile |
54 |
{ |
|
|
55 |
rm -f "${pidfile}" |
44 |
} |
56 |
} |
45 |
|
57 |
|
46 |
run_rc_command "$1" |
58 |
run_rc_command "$1" |