]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
socket: turn of loud logging when setting up sockopts in container fails due to privs
authorLennart Poettering <lennart@poettering.net>
Fri, 16 Jan 2026 20:47:12 +0000 (21:47 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Jan 2026 23:47:14 +0000 (08:47 +0900)
Various socktops will fail if we run in a container, due to lack of
privs (for example SO_RECVFORCE as used by the journald sockets). That's
typically not a big issue. Hence downgrade the log level.

Follow-up for: f7df0eab8d9520f37a2feaecf532d78de6ab6b7d

src/core/socket.c

index 6ce307a00f0b11861beeafdef9f1b3a72755c757..0ca9d80e0459810c99dea8cbe1dd4797c9736676 100644 (file)
@@ -1031,7 +1031,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(Socket*, socket_close_fds, NULL);
                 int _e_ = (e);                                                         \
                 log_unit_full_errno(                                                   \
                                 UNIT(s),                                               \
-                                ERRNO_IS_NOT_SUPPORTED(_e_) ? LOG_DEBUG : LOG_WARNING, \
+                                ERRNO_IS_NOT_SUPPORTED(_e_) ||                         \
+                                ERRNO_IS_PRIVILEGE(_e_) ? LOG_DEBUG : LOG_WARNING,     \
                                 _e_,                                                   \
                                 "Failed to set %s socket option, ignoring: %m",        \
                                 option);                                               \