diff --git a/patches/avahi/0001-On-SIGTERM-allow-dispatcher-to-process-event-before-.patch b/patches/avahi/0001-On-SIGTERM-allow-dispatcher-to-process-event-before-.patch index d9abc24c..6a3441fc 100644 --- a/patches/avahi/0001-On-SIGTERM-allow-dispatcher-to-process-event-before-.patch +++ b/patches/avahi/0001-On-SIGTERM-allow-dispatcher-to-process-event-before-.patch @@ -1,7 +1,7 @@ From 74ec0f8335f811e4f5becc8bbea4a52af4d3e749 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 17 Sep 2024 04:08:12 +0200 -Subject: [PATCH 1/2] On SIGTERM, allow dispatcher to process event before +Subject: [PATCH 1/3] On SIGTERM, allow dispatcher to process event before exiting Organization: Addiva Elektronik diff --git a/patches/avahi/0002-avahi-daemon-allow-adjusting-log-level.patch b/patches/avahi/0002-avahi-daemon-allow-adjusting-log-level.patch index 40be33cd..0b73ec1e 100644 --- a/patches/avahi/0002-avahi-daemon-allow-adjusting-log-level.patch +++ b/patches/avahi/0002-avahi-daemon-allow-adjusting-log-level.patch @@ -1,7 +1,7 @@ From bceb724d328f156efa4ad18f26f1760504bd093d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 27 Nov 2024 08:44:57 +0100 -Subject: [PATCH 2/2] avahi-daemon: allow adjusting log level +Subject: [PATCH 2/3] avahi-daemon: allow adjusting log level Organization: Addiva Elektronik Signed-off-by: Joachim Wiberg diff --git a/patches/avahi/0003-avahi-daemon-improve-error-reporting-in-chroot-commu.patch b/patches/avahi/0003-avahi-daemon-improve-error-reporting-in-chroot-commu.patch new file mode 100644 index 00000000..5de92a72 --- /dev/null +++ b/patches/avahi/0003-avahi-daemon-improve-error-reporting-in-chroot-commu.patch @@ -0,0 +1,60 @@ +From 50ddfbefe5ac4d87040cb177e7cf432d4da04e97 Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Wed, 26 Feb 2025 17:42:08 +0100 +Subject: [PATCH 3/3] avahi-daemon: improve error reporting in chroot + communication +Organization: Addiva Elektronik + +Improve logging of error in chroot communication by including the +filename in the log message. Instead of this: + + avahi-daemon[3590]: chroot.c: open() failed: No such file or directory + +log this: + + avahi-daemon[3590]: chroot.c: open(/etc/resolv.conf) failed: No such file or directory + +Which on a system with resolvconf would make the sysadmin a lot calmer, +since the file had not yet been created at boot. + +Signed-off-by: Joachim Wiberg +--- + avahi-daemon/chroot.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/avahi-daemon/chroot.c b/avahi-daemon/chroot.c +index ccd56be..fbaad69 100644 +--- a/avahi-daemon/chroot.c ++++ b/avahi-daemon/chroot.c +@@ -237,12 +237,13 @@ static int helper_main(int fd) { + case AVAHI_CHROOT_GET_RECORD_BROWSER_INTROSPECT: + #endif + case AVAHI_CHROOT_GET_RESOLV_CONF: { ++ const char *fn = get_file_name_table[(int) command]; + int payload; + +- if ((payload = open(get_file_name_table[(int) command], O_RDONLY)) < 0) { ++ if ((payload = open(fn, O_RDONLY)) < 0) { + uint8_t c = AVAHI_CHROOT_FAILURE; + +- avahi_log_error(__FILE__": open() failed: %s", strerror(errno)); ++ avahi_log_error(__FILE__": open(%s) failed: %s", fn, strerror(errno)); + + if (write(fd, &c, sizeof(c)) != sizeof(c)) { + avahi_log_error(__FILE__": write() failed: %s\n", strerror(errno)); +@@ -262,9 +263,11 @@ static int helper_main(int fd) { + + case AVAHI_CHROOT_UNLINK_SOCKET: + case AVAHI_CHROOT_UNLINK_PID: { ++ const char *fn = unlink_file_name_table[(int) command]; + uint8_t c = AVAHI_CHROOT_SUCCESS; + +- unlink(unlink_file_name_table[(int) command]); ++ if (unlink(fn) && errno != ENOENT) ++ avahi_log_error(__FILE__": unlink(%s) failed: %s", fn, strerror(errno)); + + if (write(fd, &c, sizeof(c)) != sizeof(c)) { + avahi_log_error(__FILE__": write() failed: %s\n", strerror(errno)); +-- +2.43.0 +