diff --git a/meta-digi-dey/recipes-core/systemd/systemd/0002-sd-resolve-forcefully-cancel-worker-threads-during-r.patch b/meta-digi-dey/recipes-core/systemd/systemd/0002-sd-resolve-forcefully-cancel-worker-threads-during-r.patch new file mode 100644 index 000000000..7f9d7f940 --- /dev/null +++ b/meta-digi-dey/recipes-core/systemd/systemd/0002-sd-resolve-forcefully-cancel-worker-threads-during-r.patch @@ -0,0 +1,30 @@ +From: Gabriel Valcazar +Date: Thu, 28 Mar 2019 17:40:00 +0100 +Subject: [PATCH] sd-resolve: forcefully cancel worker threads during + resolve_free + +For services that use sd-resolve, such as timesyncd, this prevents the system +from stalling whenever the service stops while a worker thread is busy calling +getaddrinfo(). + +Signed-off-by: Gabriel Valcazar +--- + src/libsystemd/sd-resolve/sd-resolve.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c +index a189f14..571604c 100644 +--- a/src/libsystemd/sd-resolve/sd-resolve.c ++++ b/src/libsystemd/sd-resolve/sd-resolve.c +@@ -577,8 +577,10 @@ static void resolve_free(sd_resolve *resolve) { + + /* Now terminate them and wait until they are gone. + If we get an error than most likely the thread already exited. */ +- for (i = 0; i < resolve->n_valid_workers; i++) ++ for (i = 0; i < resolve->n_valid_workers; i++) { ++ pthread_cancel(resolve->workers[i]); + (void) pthread_join(resolve->workers[i], NULL); ++ } + + /* Close all communication channels */ + close_many(resolve->fds, _FD_MAX); diff --git a/meta-digi-dey/recipes-core/systemd/systemd_%.bbappend b/meta-digi-dey/recipes-core/systemd/systemd_%.bbappend index 4efaad656..68c00a54e 100644 --- a/meta-digi-dey/recipes-core/systemd/systemd_%.bbappend +++ b/meta-digi-dey/recipes-core/systemd/systemd_%.bbappend @@ -1,6 +1,9 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" -SRC_URI += "file://0001-udev-use-the-usual-set-of-load-paths-for-udev-rules.patch" +SRC_URI += " \ + file://0001-udev-use-the-usual-set-of-load-paths-for-udev-rules.patch \ + file://0002-sd-resolve-forcefully-cancel-worker-threads-during-r.patch \ +" #FIX-it: Workaround as missing ending slash in FIRMWARE_PATH [YOCIMX-2831] EXTRA_OEMESON_remove = "-Dfirmware-path=${nonarch_base_libdir}/firmware "