Severity: normal
Package: bsdutils
Version: 1:2.26.2-9
Hi guys,
I just found out that /usr/bin/logger does not correctly report error when
it's not able to send messages to syslog.
Here are the steps to reproduce:
When everything's running fine, it sends the message to /dev/log and exits
0:
strace -f logger -i -d -p local0.alert 'Syslog test'
(...)
lstat("/run/systemd/system/", {st_mode=S_IFDIR|0755, st_size=120, ...}) = 0
socket(PF_LOCAL, SOCK_DGRAM, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/log"}, 110) = 0
(...)
write(3, "<129>Aug 12 20:24:25 cyb[28848]:"..., 44) = 44
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(0) = ?
+++ exited with 0 +++
Bug when syslog is not available, it's not able to send log messages but
does not report error message nor exit with non-true return code:
sudo /etc/init.d/rsyslog stop
(...)
strace -f logger -i -d -p local0.alert 'Syslog test'
(...)
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/log"}, 110) = -1 ENOENT (No
such file or directory)
^^^^^^^^^^^^^^^^^^^^^^^^^
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(0) = ?
+++ exited with 0 +++
^^^^^^^^^^^^^
it stills returns "true" (0) and does not show any error message.
The expected behavior is print an error message and exist with a non-true
return message.
Would it be possible?
Thanks.
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored:
LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages bsdutils depends on:
ii libc6 2.19-19
ii libsystemd0 224-1
Versions of packages bsdutils recommends:
ii bsdmainutils 9.0.6
bsdutils suggests no packages.
-- no debconf information
--
,''`.
: :' : Cyril Bouthors
`. `' Debian.org
`-