Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/syslogd
Show All 15 Lines | |||||
rcvar="syslogd_enable" | rcvar="syslogd_enable" | ||||
pidfile="/var/run/syslog.pid" | pidfile="/var/run/syslog.pid" | ||||
command="/usr/sbin/${name}" | command="/usr/sbin/${name}" | ||||
required_files="/etc/syslog.conf" | required_files="/etc/syslog.conf" | ||||
start_precmd="syslogd_precmd" | start_precmd="syslogd_precmd" | ||||
extra_commands="reload" | extra_commands="reload" | ||||
sockfile="/var/run/syslogd.sockets" | sockfile="/var/run/syslogd.sockets" | ||||
privsockfile="/var/run/syslogd.privsockets" | |||||
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" | evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" | ||||
syslogd_precmd() | syslogd_precmd() | ||||
{ | { | ||||
local _l _ldir | local _l _ldir | ||||
# Transitional symlink for old binaries | # Transitional symlink for old binaries | ||||
# | # | ||||
if [ ! -L /dev/log ] && ! check_jail jailed; then | if [ ! -L /dev/log ] && ! check_jail jailed; then | ||||
ln -sf /var/run/log /dev/log | ln -sf /var/run/log /dev/log | ||||
fi | fi | ||||
rm -f /var/run/log | rm -f /var/run/log | ||||
# Create default list of syslog sockets to watch | # Create default list of syslog sockets to watch | ||||
# | # | ||||
( umask 022 ; > $sockfile ) | ( umask 022 ; > $sockfile ) | ||||
( umask 022 ; > $privsockfile ) | |||||
# If running named(8) or ntpd(8) chrooted, added appropriate | # If running named(8) or ntpd(8) chrooted, added appropriate | ||||
# syslog socket to list of sockets to watch. | # syslog socket to list of sockets to watch. | ||||
# | # | ||||
for _l in $altlog_proglist; do | for _l in $altlog_proglist; do | ||||
eval _ldir=\$${_l}_chrootdir | eval _ldir=\$${_l}_chrootdir | ||||
if checkyesno ${_l}_enable && [ -n "$_ldir" ]; then | if checkyesno ${_l}_enable && [ -n "$_ldir" ]; then | ||||
echo "${_ldir}/var/run/log" >> $sockfile | echo "${_ldir}/var/run/log" >> $sockfile | ||||
fi | fi | ||||
done | done | ||||
# We can also provide logging facilities to jails | |||||
# Jails might need a log socket for priviledged applications too | |||||
dch: s/priviledged/privileged/ | |||||
0mpUnsubmitted Not Done Inline ActionsComments seems to be indented in a slightly different way in this file. Could you new comments in a similar fashion to maintain a uniform style? 0mp: Comments seems to be indented in a slightly different way in this file. Could you new comments… | |||||
for _j in $altlog_jaillist; do | |||||
_ldir=`jls -aj $_j path` | |||||
Done Inline ActionsThis line seems to be indented with spaces, and subsequent lines with a mix of tabs -- these should be entirely tabs kevans: This line seems to be indented with spaces, and subsequent lines with a mix of tabs -- these… | |||||
Not Done Inline Actionsjls -aj foo path doesn't return anything useful if the jail isn't running, so we should probably silence the error here. freebsd_igalic.co: `jls -aj foo path` doesn't return anything useful if the jail isn't running, so we should… | |||||
echo "${_ldir}/var/run/log" >> $sockfile | |||||
echo "${_ldir}/var/run/logpriv" >> $privsockfile | |||||
done | |||||
# If other sockets have been provided, change run_rc_command()'s | # If other sockets have been provided, change run_rc_command()'s | ||||
# internal copy of $syslogd_flags to force use of specific | # internal copy of $syslogd_flags to force use of specific | ||||
# syslogd sockets. | # syslogd sockets. | ||||
# | # | ||||
if [ -s $sockfile ]; then | if [ -s $sockfile ]; then | ||||
echo "/var/run/log" >> $sockfile | echo "/var/run/log" >> $sockfile | ||||
eval $evalargs | eval $evalargs | ||||
fi | fi | ||||
if [ -s $privsockfile ]; then | |||||
echo "/var/run/logpriv" >> $privsockfile | |||||
eval $evalargs | |||||
fi | |||||
return 0 | return 0 | ||||
} | } | ||||
set_socketlist() | set_socketlist() | ||||
{ | { | ||||
local _s _socketargs | local _s _socketargs | ||||
_socketargs= | _socketargs= | ||||
for _s in `cat $sockfile | tr '\n' ' '` ; do | for _s in `cat $sockfile | tr '\n' ' '` ; do | ||||
_socketargs="-l $_s $_socketargs" | _socketargs="-l $_s $_socketargs" | ||||
done | |||||
for _s in `cat $privsockfile | tr '\n' ' '` ; do | |||||
_socketargs="-S $_s $_socketargs" | |||||
done | done | ||||
echo $_socketargs | echo $_socketargs | ||||
} | } | ||||
load_rc_config $name | load_rc_config $name | ||||
run_rc_command "$1" | run_rc_command "$1" |
s/priviledged/privileged/