Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#10435 closed enhancement (obsolete)

Patch for Busybox 1.19.2 using TCP in syslogd

Reported by: David Schueler <david.schueler@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Trunk
Keywords: busybox syslogd remote log tcp Cc:



I'm using stunnel to get syslog messages from my OpenWrt routers to a logserver. stunnel only accepts TCP connections. On my server i use syslog-ng, which is able to receive messages on a TCP port. The syslogd from busybox only supports logging to a UDP port.

So i made this patch for busybox 1.19.2 to use TCP instead of UDP.
It's a bit hacky, because the syslog server treats all incoming log messages via stunnel as "localhost" messages. so i added the original hostname in brackets [...] and added the log priority.

The log message on the remote syslog server now looks like this
Jan 1 00:00:31 localhost [OpenWrt] kern.warn kernel: jffs2_build_filesystem(): unlocking the mtd device... done.

To use this patch, i copied it to package/busybox/patches/930-syslog_tcp.patch

It needs some enhancement, to use TCP or UDP by a command line switch (maybe -T ?).
Maybe someone will add some more functionality to it. for me it works at the moment.



Attachments (3)

syslog.patch (3.9 KB) - added by David Schueler <david.schueler@…> 6 years ago.
syslog.2.patch (4.0 KB) - added by David Schueler <david.schueler@…> 6 years ago.
Bugfix to previous patch.
930-syslog_tcp.patch (4.2 KB) - added by David Schueler <david.schueler@…> 6 years ago.
Final bugfix (Fixes a NULL termination in recvbuf)

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by David Schueler <david.schueler@…>

Changed 6 years ago by David Schueler <david.schueler@…>

Bugfix to previous patch.

Changed 6 years ago by David Schueler <david.schueler@…>

Final bugfix (Fixes a NULL termination in recvbuf)

comment:1 Changed 5 years ago by ben@…

Here is a derivative of your patch which only inserts [hostname] into the outgoing log messages. Remote logging still done over UDP.

Does it make sense then to re-spin this patch so it only contains the changes necessary for doing remote logging over TCP?

comment:2 Changed 4 years ago by nbd

  • Resolution set to obsolete
  • Status changed from new to closed

busybox syslogd is no longer being used. procd syslog support (+ logread) supports relaying log data via TCP.

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.