Tighten up check for 'syslogd -C'

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5064 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-06 16:37:29 +00:00
parent 07769b5594
commit 425402114f
2 changed files with 21 additions and 1 deletions

View File

@ -120,6 +120,26 @@ timed_read ()
test $? -eq 2 && sleep $timeout
}
#
# Determine if 'syslog -C' is running
#
syslog_circular_buffer() {
local pid tty flags cputime path args arg
ps ax 2> /dev/null | while read pid tty flags cputime path args; do
case $path in
syslogd|*/syslogd)
for arg in $args; do
if [ x$arg = x-C ]; then
echo Yes
return
fi
done
;;
esac
done
}
#
# Display the last $1 packets logged
#

View File

@ -128,7 +128,7 @@ get_config() {
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
if ( ps ax 2> /dev/null | grep -v grep | qt grep 'syslogd.*-C' ) ; then
if [ -n "$(syslog_circular_buffer)" ]; then
LOGREAD="logread"
elif [ -f $LOGFILE ]; then
LOGREAD="cat $LOGFILE"