It works fine and I can see log messages on the remote host. But only till "ifup" command executed (or network service restarted). After that I get this behavior of a logread:
root@client1:~# /sbin/logread -f -h client1 -r 10.8.0.1 514 -p /var/run/logread.2.pid -u
failed to connect: Permission denied
failed to connect: Permission denied
failed to connect: Permission denied
failed to connect: Permission denied
failed to connect: Permission denied
...
It's not a firewall problem, I stop it by '/etc/init.d/firewall stop'. If I send log message manually by nc -u 10.8.0.1 514 it works.
What's the problem can be?
you cannot send ip traffic while an adapter is down
does a ping stream result in no lost packets / delays to the same ip with the same commands?
does nc work while running equivalent commands in another terminal ( ifup / restart )?
if so, then you might assume that logread ( to a remote destination ) has little or no error handling ( send fail -> buffer -> flush )
Yes, all adapters are needed have a state "up" after network changed. Remote host is "up" too and openwrt system has ip-connectivity to them (vie ping, ssh etc).
I can start "nc" anywere -- at the another terminal, at the same terminal -- all it work. I even do not stop "nc" before "ifup" command -- it works too.
It seems like logread use "something" (socket, device what ever) which permissions change after network state change. And this "something" changing is a reason of the problem.
but... it's the socket/network... and it's normal behavior.... it "loses permissions" ( cannot write ) because the socket is not there.... ( or it is blocked from doing so by netifd/ubus )
"unable to send log message network is down"... simple
you may wish to use another logging program if you need more functionality....