diff options
author | Luca Boccassi <bluca@debian.org> | 2023-06-19 13:14:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 13:14:28 +0200 |
commit | 14cb29dfd5fce8667cd77db00cb57572abdd9ad8 (patch) | |
tree | 0f5161435f29024fc19dd896a5e19731fa6b677c | |
parent | homework: resize to maximum disk space if disk size is not specified (diff) | |
parent | test: wrap curl when running with ASan (diff) | |
download | systemd-14cb29dfd5fce8667cd77db00cb57572abdd9ad8.tar.xz systemd-14cb29dfd5fce8667cd77db00cb57572abdd9ad8.zip |
Merge pull request #28074 from mrc0mmand/journal-gatewayd-followups
A couple of follow-ups for systemd-journal-gatewayd tests
-rw-r--r-- | src/journal-remote/journal-gatewayd.c | 6 | ||||
-rw-r--r-- | test/test-functions | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index f9bff4fb97..980b98137e 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -31,6 +31,7 @@ #include "parse-util.h" #include "pretty-print.h" #include "sigbus.h" +#include "signal-util.h" #include "tmpfile-util.h" #define JOURNAL_WAIT_TIMEOUT (10*USEC_PER_SEC) @@ -1004,6 +1005,10 @@ static int parse_argv(int argc, char *argv[]) { static int run(int argc, char *argv[]) { _cleanup_(MHD_stop_daemonp) struct MHD_Daemon *d = NULL; + static const struct sigaction sigterm = { + .sa_handler = nop_signal_handler, + .sa_flags = SA_RESTART, + }; struct MHD_OptionItem opts[] = { { MHD_OPTION_EXTERNAL_LOGGER, (intptr_t) microhttpd_logger, NULL }, @@ -1040,6 +1045,7 @@ static int run(int argc, char *argv[]) { return r; sigbus_install(); + assert_se(sigaction(SIGTERM, &sigterm, NULL) >= 0); r = setup_gnutls_logger(NULL); if (r < 0) diff --git a/test/test-functions b/test/test-functions index 0a5a67f7d1..2b112fbb2a 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1316,12 +1316,14 @@ install_systemd() { if get_bool "$IS_BUILT_WITH_COVERAGE"; then mkdir -p "$initdir/etc/systemd/system/service.d/" echo -ne "[Service]\nProtectSystem=no\nProtectHome=no\n" >"$initdir/etc/systemd/system/service.d/99-gcov-override.conf" - # Similarly, set ReadWritePaths= to the $BUILD_DIR in the test image - # to make the coverage work with units using DynamicUser=yes. Do this - # only for services with test- prefix, as setting this system-wide - # has many undesirable side-effects, as it creates its own namespace. - mkdir -p "$initdir/etc/systemd/system/test-.service.d/" - echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/test-.service.d/99-gcov-rwpaths-override.conf" + # Similarly, set ReadWritePaths= to the $BUILD_DIR in the test image to make the coverage work with + # units using DynamicUser=yes. Do this only for services with test- prefix and a couple of + # known-to-use DynamicUser=yes services, as setting this system-wide has many undesirable + # side-effects, as it creates its own namespace. + for service in test- systemd-journal-{gatewayd,upload}; do + mkdir -p "$initdir/etc/systemd/system/$service.service.d/" + echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/system/$service.service.d/99-gcov-rwpaths-override.conf" + done # Ditto, but for the user daemon mkdir -p "$initdir/etc/systemd/user/test-.service.d/" echo -ne "[Service]\nReadWritePaths=${BUILD_DIR:?}\n" >"$initdir/etc/systemd/user/test-.service.d/99-gcov-rwpaths-override.conf" @@ -2735,7 +2737,7 @@ inst_binary() { # nsswitch.conf uses [SUCCESS=merge] (like on Arch Linux) # delv, dig - pull in nss_resolve if `resolve` is in nsswitch.conf # tar - called by machinectl in TEST-25 - bin_rx='/(agetty|chown|delv|dig|getfacl|getent|id|login|ls|mkfs\.[a-z0-9]+|mksquashfs|mkswap|setfacl|setpriv|stat|su|tar|useradd|userdel)$' + bin_rx='/(agetty|chown|curl|delv|dig|getfacl|getent|id|login|ls|mkfs\.[a-z0-9]+|mksquashfs|mkswap|setfacl|setpriv|stat|su|tar|useradd|userdel)$' if get_bool "$IS_BUILT_WITH_ASAN" && [[ "$bin" =~ $bin_rx ]]; then wrap_binary=1 fi |