From a6efb32b0e9c86f8fb7b6f50061c302217c7a736 Mon Sep 17 00:00:00 2001 From: ophestra Date: Sat, 7 Dec 2024 22:04:42 +0900 Subject: [PATCH] rtkit: fix reduce logging patch URL (#360182) GitHub returns HTTP 406 for pull request commits superseded by a force push. --- ...son-actual-use-systemd_systemunitdir.patch | 22 ++++++ .../meson-fix-librt-find_library-check.patch | 22 ++++++ pkgs/by-name/rt/rtkit/package.nix | 20 +---- ...n-dont-log-debug-messages-by-default.patch | 73 +++++++++++++++++++ 4 files changed, 120 insertions(+), 17 deletions(-) create mode 100644 pkgs/by-name/rt/rtkit/meson-actual-use-systemd_systemunitdir.patch create mode 100644 pkgs/by-name/rt/rtkit/meson-fix-librt-find_library-check.patch create mode 100644 pkgs/by-name/rt/rtkit/rtkit-daemon-dont-log-debug-messages-by-default.patch diff --git a/pkgs/by-name/rt/rtkit/meson-actual-use-systemd_systemunitdir.patch b/pkgs/by-name/rt/rtkit/meson-actual-use-systemd_systemunitdir.patch new file mode 100644 index 000000000000..fa1ca26088ce --- /dev/null +++ b/pkgs/by-name/rt/rtkit/meson-actual-use-systemd_systemunitdir.patch @@ -0,0 +1,22 @@ +From 7d62095b94f8df3891c984a1535026d2658bb177 Mon Sep 17 00:00:00 2001 +From: Edmund Wu +Date: Sat, 11 Apr 2020 16:59:35 -0400 +Subject: [PATCH] meson: actually use systemd_systemunitdir + +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 02e6c73..ba5ba1e 100644 +--- a/meson.build ++++ b/meson.build +@@ -58,7 +58,7 @@ if policydir == '' + policydir = get_option('datadir') / 'polkit-1' / 'actions' + endif + +-systemunitdir = '' ++systemunitdir = get_option('systemd_systemunitdir') + if systemunitdir == '' and systemd_dep.found() + systemunitdir = systemd_dep.get_pkgconfig_variable( + 'systemdsystemunitdir', diff --git a/pkgs/by-name/rt/rtkit/meson-fix-librt-find_library-check.patch b/pkgs/by-name/rt/rtkit/meson-fix-librt-find_library-check.patch new file mode 100644 index 000000000000..54992e84ca66 --- /dev/null +++ b/pkgs/by-name/rt/rtkit/meson-fix-librt-find_library-check.patch @@ -0,0 +1,22 @@ +From 98f70edd8f534c371cb4308b9720739c5178918d Mon Sep 17 00:00:00 2001 +From: Felipe Sateler +Date: Sat, 11 Apr 2020 10:59:21 -0400 +Subject: [PATCH] meson: fix librt find_library check + +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 02e6c73..49da472 100644 +--- a/meson.build ++++ b/meson.build +@@ -22,7 +22,7 @@ polkit_dep = dependency('polkit-gobject-1', required: false) + systemd_dep = dependency('systemd', required: false) + thread_dep = dependency('threads') + +-librt_dep = cc.find_library('z') ++librt_dep = cc.find_library('rt') + cc.check_header('sched.h', dependencies: librt_dep) + cc.has_function('sched_setscheduler', dependencies: librt_dep) + diff --git a/pkgs/by-name/rt/rtkit/package.nix b/pkgs/by-name/rt/rtkit/package.nix index 9c580edc308f..12dc6bbe392f 100644 --- a/pkgs/by-name/rt/rtkit/package.nix +++ b/pkgs/by-name/rt/rtkit/package.nix @@ -15,23 +15,9 @@ stdenv.mkDerivation rec { }; patches = [ - (fetchpatch { - name = "meson-actual-use-systemd_systemunitdir.patch"; - url = "https://github.com/heftig/rtkit/pull/19/commits/7d62095b94f8df3891c984a1535026d2658bb177.patch"; - sha256 = "17acv549zqcgh7sgprfagbf6drqsr0zdwvf1dsqda7wlqc2h9zn7"; - }) - - (fetchpatch { - name = "meson-fix-librt-find_library-check.patch"; - url = "https://github.com/heftig/rtkit/pull/18/commits/98f70edd8f534c371cb4308b9720739c5178918d.patch"; - sha256 = "18mnjjsdjfr184nkzi01xyphpdngi31ry4bmkv9ysjxf9wilv4nl"; - }) - - (fetchpatch { - name = "rtkit-daemon-dont-log-debug-messages-by-default.patch"; - url = "https://github.com/heftig/rtkit/pull/33/commits/ad649ee491ed1a41537774ad11564a208e598a09.patch"; - sha256 = "sha256-p+MdJVMv58rFd1uc1UFKtq83RquDSFZ3M6YfaBU12UU="; - }) + ./meson-actual-use-systemd_systemunitdir.patch + ./meson-fix-librt-find_library-check.patch + ./rtkit-daemon-dont-log-debug-messages-by-default.patch ]; nativeBuildInputs = [ meson ninja pkg-config unixtools.xxd ]; diff --git a/pkgs/by-name/rt/rtkit/rtkit-daemon-dont-log-debug-messages-by-default.patch b/pkgs/by-name/rt/rtkit/rtkit-daemon-dont-log-debug-messages-by-default.patch new file mode 100644 index 000000000000..667d80ab6915 --- /dev/null +++ b/pkgs/by-name/rt/rtkit/rtkit-daemon-dont-log-debug-messages-by-default.patch @@ -0,0 +1,73 @@ +From 4880b9c67628a781bdb183dcdc69f12cb829817d Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Sat, 15 Apr 2023 11:53:27 +0200 +Subject: [PATCH] rtkit-daemon: Don't log debug messages by default + +The rtkit-daemon service is a lot more verbose than other services +when it doesn't have anything to do. Stop logging the debug messages +by default to avoid flooding the system log. + +This addresses issue #22. +--- + rtkit-daemon.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/rtkit-daemon.c b/rtkit-daemon.c +index 17122fa..0c5d814 100644 +--- a/rtkit-daemon.c ++++ b/rtkit-daemon.c +@@ -154,6 +154,9 @@ static bool canary_demote_unknown = FALSE; + /* Log to stderr? */ + static bool log_stderr = FALSE; + ++/* Also log debugging messages? */ ++static bool log_debug = FALSE; ++ + /* Scheduling policy to use */ + static int sched_policy = SCHED_RR; + +@@ -1876,6 +1879,7 @@ enum { + ARG_CANARY_DEMOTE_UNKNOWN, + ARG_CANARY_REFUSE_SEC, + ARG_STDERR, ++ ARG_DEBUG, + ARG_INTROSPECT + }; + +@@ -1905,6 +1909,7 @@ static const struct option long_options[] = { + { "canary-demote-unknown", no_argument, 0, ARG_CANARY_DEMOTE_UNKNOWN }, + { "canary-refuse-sec", required_argument, 0, ARG_CANARY_REFUSE_SEC }, + { "stderr", no_argument, 0, ARG_STDERR }, ++ { "debug", no_argument, 0, ARG_DEBUG }, + { "introspect", no_argument, 0, ARG_INTROSPECT }, + { NULL, 0, 0, 0} + }; +@@ -1933,6 +1938,7 @@ static void show_help(const char *exe) { + " --version Show version\n\n" + "OPTIONS:\n" + " --stderr Log to STDERR in addition to syslog\n" ++ " --debug Also log debugging mssages\n" + " --user-name=USER Run daemon as user (%s)\n\n" + " --scheduling-policy=(RR|FIFO) Choose scheduling policy (%s)\n" + " --our-realtime-priority=[%i..%i] Realtime priority for the daemon (%u)\n" +@@ -2222,6 +2228,10 @@ static int parse_command_line(int argc, char *argv[], int *ret) { + log_stderr = TRUE; + break; + ++ case ARG_DEBUG: ++ log_debug = TRUE; ++ break; ++ + case ARG_INTROSPECT: + fputs(introspect_xml, stdout); + *ret = 0; +@@ -2251,6 +2261,9 @@ static int parse_command_line(int argc, char *argv[], int *ret) { + return -1; + } + ++ if (!log_debug) ++ setlogmask(LOG_UPTO(LOG_INFO)); ++ + assert(our_realtime_priority >= (unsigned) sched_get_priority_min(sched_policy)); + assert(our_realtime_priority <= (unsigned) sched_get_priority_max(sched_policy)); +