mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
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:
parent
07769b5594
commit
425402114f
@ -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
|
||||
#
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user