syslogd remote logging regression

Denys Vlasenko vda.linux at googlemail.com
Tue Dec 9 22:50:54 UTC 2008


On Tuesday 09 December 2008 13:09, Alexander Griesser wrote:
> Hi all,
> 
> Today I was trying to set up remote logging on my thinclients using the
> syslogd applet in 1.13.1.
> 
> Out of the box, it didn't work, I used the following command to start
> syslogd:
> 
> syslogd -L -R logserver.local
> 
> So, syslogd should log locally (-L) and to our logserver.
> That didn't work, it just logged locally.
> 
> I then tried to log only to the logserver, which worked (omitting the
> -L parameter) and finally noticed, that both options work if I change
> the order of appearance, so:
> 
> syslogd -R logserver.local -L      works, whereas
> syslogd -L -R logserver.local      does only log local.
> 
> Can anyone reproduce that? I can reproduce that everytime I try, just
> in case.

Tried to reproduce and it works for me both ways.
(I also added -n in order to not daemonize it).

These two lines will show whether it even tries to find remote,
and whether it succeeds:

static int try_to_resolve_remote(void)
{
bb_error_msg("try_to_resolve_remote"); <==========
        if (!G.remoteAddr) {
                unsigned now = monotonic_sec();

                /* Don't resolve name too often - DNS timeouts can be big */
                if ((now - G.last_dns_resolve) < DNS_WAIT_SEC)
                        return -1;
                G.last_dns_resolve = now;
                G.remoteAddr = host2sockaddr(G.remoteAddrStr, 514);
                if (!G.remoteAddr)
                        return -1;
bb_error_msg("try_to_resolve_remote success"); <============
        }
        return socket(G.remoteAddr->u.sa.sa_family, SOCK_DGRAM, 0);
}

You can also check whether OPT_remotelog bit is set in option_mask32
here (it should be):

        umask(0);
        write_pidfile("/var/run/syslogd.pid");
bb_error_msg("opt %x OPT_remotelog %x", option_mask32, OPT_remotelog); <==
        do_syslogd();
        /* return EXIT_SUCCESS; */
}

What do you see with this debugging added?
--
vda



More information about the busybox mailing list