diff options
author | yar <yar@FreeBSD.org> | 2006-12-30 22:53:20 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-12-30 22:53:20 +0000 |
commit | c91e4c56f635b3ce863d881f8a49d213248826f9 (patch) | |
tree | 48f5b2fe4337977e994033a03ecdb0d82ffe59a6 /etc/rc.d/syslogd | |
parent | 04d777c063bfd2bb16af385cd179669da6a2404e (diff) | |
download | FreeBSD-src-c91e4c56f635b3ce863d881f8a49d213248826f9.zip FreeBSD-src-c91e4c56f635b3ce863d881f8a49d213248826f9.tar.gz |
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
Diffstat (limited to 'etc/rc.d/syslogd')
-rwxr-xr-x | etc/rc.d/syslogd | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/rc.d/syslogd b/etc/rc.d/syslogd index 45e50f8..272d6b0 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 |