Accepting request 1094971 from home:jdelvare:branches:Base:System

rtkit-daemon: Don't log debug messages by default (bsc#1206745).

OBS-URL: https://build.opensuse.org/request/show/1094971
OBS-URL: https://build.opensuse.org/package/show/Base:System/rtkit?expand=0&rev=48
This commit is contained in:
Marcus Meissner 2023-06-26 07:03:16 +00:00 committed by Git OBS Bridge
parent 0fcc920fff
commit b53e585e35
3 changed files with 83 additions and 3 deletions

View File

@ -0,0 +1,71 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: rtkit-daemon: Don't log debug messages by default
References: bsc#1206745
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 the following upstream issue:
https://github.com/heftig/rtkit/issues/22
---
rtkit-daemon.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- rtkit-0.13.orig/rtkit-daemon.c
+++ rtkit-0.13/rtkit-daemon.c
@@ -154,6 +154,9 @@ static bool canary_demote_unknown = FALS
/* 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,
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,
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));

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 23 11:30:20 UTC 2023 - Jean Delvare <jdelvare@suse.com>
- rtkit-daemon: Don't log debug messages by default (bsc#1206745).
Added patch(es):
* rtkit-silent-debug-messages-by-default.patch
-------------------------------------------------------------------
Fri Dec 31 13:12:17 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package rtkit
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -27,12 +27,13 @@ Group: System/Base
URL: https://github.com/heftig/rtkit
Source: https://github.com/heftig/rtkit/releases/download/v%{version}/rtkit-%{version}.tar.xz
Source1: rtkit.sysusers
Patch0: harden_rtkit-daemon.service.patch
Patch0: harden_rtkit-daemon.service.patch
Patch1: rtkit-silent-debug-messages-by-default.patch
BuildRequires: automake
BuildRequires: libcap-devel
BuildRequires: pkg-config
BuildRequires: sysuser-tools
BuildRequires: systemd-rpm-macros
BuildRequires: sysuser-tools
BuildRequires: vim
BuildRequires: xz
BuildRequires: pkgconfig(dbus-1) >= 1.2
@ -52,6 +53,7 @@ scheduling to be used by normal user processes.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%sysusers_generate_pre %{SOURCE1} rtkit rtkit.conf