Hi tom,
What need to be also changed:
I have added a pattern for logd in the case statement in the function
syslog_circular_buffer:
syslog_circular_buffer() {
local pid
local tty
local flags
local cputime
local path
local args
local arg
ps 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
;;
logd|*/logd)
for arg in $args; do
if [ x$arg = x-S ]; then
echo Yes
return
fi
done
;;
esac
done
}
and I have also added for logd a condition in the if statement:
In the code block:
g_logread=logread
LOGFILE=logread -- LOGFILE will display logread instead of the
default value of LOGFILE
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
if ( ps ax 2> /dev/null | grep -v grep | qt grep 'syslogd.*-C' )
; then
g_logread="logread | tac"
elif ps2> /dev/null | grep -v grep | grep 'logd.*-S'; then
g_logread=logread
LOGFILE=$g_logread
elif [ -r $LOGFILE ]; then
g_logread="tac $LOGFILE"
else
fatal_error "LOGFILE ($LOGFILE) does not exist!"
fi
On openwrt "ps" can only be used with "w" and not with "ax"!
-Matt
On 29 Oct 2015 at 18:25, Tom Eastep wrote:
> On 10/28/2015 2:06 PM, matt darfeuille wrote:
> > Using both patches seems to do it(I will do more testing tomorrow)!
> >
> > Regarding loging on openwrt:
> >
> > Yes openwrt has changed from using syslogd to logd!
> >
> > "Older OpenWrt releases(AA and earlier ones) were using BusyBox's
> > syslogd (and logread) while the newer ones (BB and later) use
> > ubox's logd and logread."
> > from:
> > http://wiki.openwrt.org/doc/howto/log.essentials
> >
> > While reading the provided code and in lib.cli it is now obvious why
> > it does not work!!!:)
>
> So other than the missing 'tac', what else in the current Shorewall code
> needs changing?
>
> >
> > Also tac is not available on openwrt(maybe using awk ...)!
> >
>
> We can just pipe the output of 'logread' into 'tail'
>
> -Tom
> --
> Tom Eastep \ When I die, I want to go like my Grandfather who
> Shoreline, \ died peacefully in his sleep. Not screaming like
> Washington, USA \ all of the passengers in his car
> http://shorewall.net \________________________________________________
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Shorewall-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/shorewall-users
------------------------------------------------------------------------------
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users