rtkit: fix reduce logging patch URL (#360182)

GitHub returns HTTP 406 for pull request commits superseded by a force
push.
This commit is contained in:
ophestra 2024-12-07 22:04:42 +09:00 committed by GitHub
parent 72a1655a03
commit a6efb32b0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 120 additions and 17 deletions

View File

@ -0,0 +1,22 @@
From 7d62095b94f8df3891c984a1535026d2658bb177 Mon Sep 17 00:00:00 2001
From: Edmund Wu <fangkazuto@gmail.com>
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',

View File

@ -0,0 +1,22 @@
From 98f70edd8f534c371cb4308b9720739c5178918d Mon Sep 17 00:00:00 2001
From: Felipe Sateler <fsateler@users.noreply.github.com>
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)

View File

@ -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 ];

View File

@ -0,0 +1,73 @@
From 4880b9c67628a781bdb183dcdc69f12cb829817d Mon Sep 17 00:00:00 2001
From: Jean Delvare <jdelvare@suse.de>
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));