aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d/syslogd
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2006-12-30 22:53:20 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2006-12-30 22:53:20 +0000
commit45da9952e505c2defec11d35a8fab56135b82bcd (patch)
tree48f5b2fe4337977e994033a03ecdb0d82ffe59a6 /etc/rc.d/syslogd
parent574c45c445a5ef97978d68eb5fe6514fd6b8006d (diff)
downloadsrc-45da9952e505c2defec11d35a8fab56135b82bcd.tar.gz
src-45da9952e505c2defec11d35a8fab56135b82bcd.zip
Eliminate global symbols starting with an underscore from rc.d
scripts, except for mdconfig* and jail. Such symbols are reserved for the rc.subr internals. Most scripts can be fixed by just declaring _foo symbols as local: few scripts actually need them to be global. Discussed with: dougb in freebsd-rc
Notes
Notes: svn path=/head/; revision=165664
Diffstat (limited to 'etc/rc.d/syslogd')
-rwxr-xr-xetc/rc.d/syslogd16
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/rc.d/syslogd b/etc/rc.d/syslogd
index 45e50f8edadc..272d6b05f2a4 100755
--- a/etc/rc.d/syslogd
+++ b/etc/rc.d/syslogd
@@ -18,12 +18,14 @@ required_files="/etc/syslog.conf"
start_precmd="syslogd_precmd"
extra_commands="reload"
-_sockfile="/var/run/syslogd.sockets"
+sockfile="/var/run/syslogd.sockets"
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
altlog_proglist="named"
syslogd_precmd()
{
+ local _l _ldir
+
# Transitional symlink for old binaries
#
if [ ! -L /dev/log ]; then
@@ -33,7 +35,7 @@ syslogd_precmd()
# Create default list of syslog sockets to watch
#
- ( umask 022 ; > $_sockfile )
+ ( umask 022 ; > $sockfile )
# If running named(8) or ntpd(8) chrooted, added appropriate
# syslog socket to list of sockets to watch.
@@ -41,7 +43,7 @@ syslogd_precmd()
for _l in $altlog_proglist; do
eval _ldir=\$${_l}_chrootdir
if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then
- echo "${_ldir}/var/run/log" >> $_sockfile
+ echo "${_ldir}/var/run/log" >> $sockfile
fi
done
@@ -49,8 +51,8 @@ syslogd_precmd()
# internal copy of $syslogd_flags to force use of specific
# syslogd sockets.
#
- if [ -s $_sockfile ]; then
- echo "/var/run/log" >> $_sockfile
+ if [ -s $sockfile ]; then
+ echo "/var/run/log" >> $sockfile
eval $evalargs
fi
@@ -59,8 +61,10 @@ syslogd_precmd()
set_socketlist()
{
+ local _s _socketargs
+
_socketargs=
- for _s in `cat $_sockfile | tr '\n' ' '` ; do
+ for _s in `cat $sockfile | tr '\n' ' '` ; do
_socketargs="-l $_s $_socketargs"
done
echo $_socketargs