When journald, from systemd, is in use logger gave following error.
$ logger --socket /dev/log test logger: connect /dev/log: Protocol wrong
type for socket
The journald supports only AF_DGRAM, and nothing else. Support for
AF_STREAM sockets was dropped because it messed up message ordering.
From an users point of view necessity to add --udp (UNIX(TM) Datagram
Protocol?) option when talking to syslog via unix socket felt confusing
and wrong. The command should know what is the socket type, and silently
use the correct one, unless the type is explicitely defined.
CC: Karel Zak <kzak@redhat.com>
Adviced-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Move these functions to the top of the file where they can be marked
static and the prototypes can be removed.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This is done for us via an atexit hook since c05a80ca63. Avoids a
useless 'Write error' on exit whenever invoking the tool.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Use getopt_long and usage output changed to match long options.
This patch will also scrutiny argument of formerly undocumented
-P option.
[kzak@redhat.com: - include c.h]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
It adds the ability to logger to log a message to a udp socket. The -n option
followed by the hostname of the remote host is mandatory to do this. The
optional -P option can be used to change the UDP destination port (default
514). The function udpopenlog is used to open the udp socket. After that
everything works in almost the same way like it does when logging to a UNIX
socket.
Signed-off-by: Josef Wuebbels <josef.wuebbels@mtu.de>
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.
Replaced with memmove,memset,strchr and strrchr.
Signed-off-by: Daniel Mierswa <impulze@impulze.org>