Lines 20-78
Link Here
|
20 |
pidfile="${rsyslogd_pidfile}" |
20 |
pidfile="${rsyslogd_pidfile}" |
21 |
command_args="-i ${pidfile} -f ${rsyslogd_config}" |
21 |
command_args="-i ${pidfile} -f ${rsyslogd_config}" |
22 |
required_files="${rsyslogd_config}" |
22 |
required_files="${rsyslogd_config}" |
23 |
start_precmd="rsyslogd_precmd" |
|
|
24 |
extra_commands="reload" |
23 |
extra_commands="reload" |
25 |
|
24 |
|
26 |
sockfile="/var/run/rsyslogd.sockets" |
|
|
27 |
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" |
28 |
altlog_proglist="named" |
29 |
|
30 |
rsyslogd_precmd() |
31 |
{ |
32 |
local _l _ldir |
33 |
|
34 |
# Transitional symlink for old binaries |
35 |
# |
36 |
if [ ! -L /dev/log ]; then |
37 |
ln -sf /var/run/log /dev/log |
38 |
fi |
39 |
rm -f /var/run/log |
40 |
|
41 |
# Create default list of syslog sockets to watch |
42 |
# |
43 |
( umask 022 ; > $sockfile ) |
44 |
|
45 |
# If running named(8) or ntpd(8) chrooted, added appropriate |
46 |
# syslog socket to list of sockets to watch. |
47 |
# |
48 |
for _l in $altlog_proglist; do |
49 |
eval _ldir=\$${_l}_chrootdir |
50 |
if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then |
51 |
echo "${_ldir}/var/run/log" >> $sockfile |
52 |
fi |
53 |
done |
54 |
|
55 |
# If other sockets have been provided, change run_rc_command()'s |
56 |
# internal copy of $rsyslogd_flags to force use of specific |
57 |
# rsyslogd sockets. |
58 |
# |
59 |
if [ -s $sockfile ]; then |
60 |
echo "/var/run/log" >> $sockfile |
61 |
eval $evalargs |
62 |
fi |
63 |
|
64 |
return 0 |
65 |
} |
66 |
|
67 |
set_socketlist() |
68 |
{ |
69 |
local _s _socketargs |
70 |
|
71 |
_socketargs= |
72 |
for _s in `cat $sockfile | tr '\n' ' '` ; do |
73 |
_socketargs="-a $_s $_socketargs" |
74 |
done |
75 |
echo $_socketargs |
76 |
} |
77 |
|
78 |
run_rc_command "$1" |
25 |
run_rc_command "$1" |