Closed jgoerzen closed 11 years ago
Yeah, it depends on the socket type of /dev/log.
If you have unix-stream("/dev/log");
then thing don't work
unix-dgram("/dev/log");
works fine though
I've hacked a workaround which switches from one to another: https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-haskell/hslogger/files/hslogger-1.2.1-use-STREAM.patch
glibc's syslog()
function tries stateless approach first, then stateful:
$ strace logger test
...
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 1
connect(1, {sa_family=AF_FILE, sun_path="/dev/log"}, 110) = -1 EPROTOTYPE (Protocol wrong type for socket)
close(1) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 1
connect(1, {sa_family=AF_FILE, sun_path="/dev/log"}, 110) = 0
sendto(1, "<13>Feb 18 19:52:41 st: test\0", 29, MSG_NOSIGNAL, NULL, 0) = 29
close(1) = 0
This fix should be a bit better:
http://software.complete.org/software/issues/show/178
Added by Magnus Therning 2009-08-23. ALL TEXT BELOW FROM SUBMITTER.
On my Arch system I ran into the following problem:
I also tried using a UDP socket (by modifying the syslog-ng config to include @unix-dgram("/dev/dlog")), but that doesn't seem to fix it:
I've tried the same on a Debian box. With sysklogd I don't have any problems, but after switching to syslog-ng I see exactly the same behaviour as on my Arch system.
The version on Arch is 1.0.7, and the version on Debian is 1.0.8. (Have you forgot to push the latest version to Hackage again? ;-)
http://article.gmane.org/gmane.comp.lang.haskell.cafe/62709