Bug#1037952: rasdaemon(1) and /etc/default/rasdaemon point to /etc/sysconfig/rasdaemon which doesn't exist on Debian

2023-06-14 Thread наб
one day i'll attach the patches i say i'm gonna
From 7a86b08751735cfd0afff941e5f7b8bd90ea1944 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= 
Date: Wed, 14 Jun 2023 19:23:16 +0200
Subject: [PATCH 1/3] Remove /etc/sysconfig reference from
 /etc/default/rasdaemon
X-Mutt-PGP: OS

---
 debian/control   | 2 +-
 debian/rasdaemon.install | 2 --
 debian/rules | 2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)
 mode change 100755 => 100644 debian/rasdaemon.install

diff --git a/debian/control b/debian/control
index 4a79b1b..c827820 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
 Priority: optional
 Maintainer: Taihsiang Ho (tai271828) 
 Build-Depends: debhelper (>= 12), quilt, libsqlite3-dev, libgettextpo-dev,
- autoconf, dh-exec
+ autoconf
 Standards-Version: 4.5.0
 Homepage: https://salsa.debian.org/tai271828/rasdaemon
 Vcs-Git: https://salsa.debian.org/tai271828/rasdaemon.git
diff --git a/debian/rasdaemon.install b/debian/rasdaemon.install
old mode 100755
new mode 100644
index 6acf933..f830f85
--- a/debian/rasdaemon.install
+++ b/debian/rasdaemon.install
@@ -1,4 +1,2 @@
-#!/usr/bin/dh-exec
 misc/rasdaemon.service	/lib/systemd/system
 misc/ras-mc-ctl.service	/lib/systemd/system
-misc/rasdaemon.env => /etc/default/rasdaemon
diff --git a/debian/rules b/debian/rules
index cbde216..9082553 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,3 +19,5 @@ override_dh_install:
 	dh_installsystemd --name=rasdaemon rasdaemon.service
 	dh_installsystemd --name=ras-mc-ctl ras-mc-ctl.service
 	rm -rf $(CURDIR)/debian/rasdaemon/usr/include
+	mkdir -p $(CURDIR)/debian/rasdaemon/etc/default
+	sed '\:/etc/sysconfig:d' < $(CURDIR)/misc/rasdaemon.env > $(CURDIR)/debian/rasdaemon/etc/default/rasdaemon
-- 
2.39.2

From 6f63004a8bff132549482815aeda0df382ec8351 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= 
Date: Wed, 14 Jun 2023 19:30:56 +0200
Subject: [PATCH 2/3] Fix config file path in rasdaemon(8)
X-Mutt-PGP: OS

---
 debian/patches/rasdaemon.8-config-path.patch | 19 +++
 debian/patches/series|  1 +
 2 files changed, 20 insertions(+)
 create mode 100644 debian/patches/rasdaemon.8-config-path.patch

diff --git a/debian/patches/rasdaemon.8-config-path.patch b/debian/patches/rasdaemon.8-config-path.patch
new file mode 100644
index 000..798d93f
--- /dev/null
+++ b/debian/patches/rasdaemon.8-config-path.patch
@@ -0,0 +1,19 @@
+diff --git a/man/rasdaemon.8.in b/man/rasdaemon.8.in
+index 833c8e1..59affb4 100644
+--- a/man/rasdaemon.8.in
 b/man/rasdaemon.8.in
+@@ -62,12 +62,8 @@ .SH OPTIONS
+ .BI "--version"
+ Print the program version and exit.
+ 
+-.SH CONFIG FILE
+-
+-The \fBrasdaemon\fR program supports a config file to set rasdaemon systemd service
+-environment variables. By default the config file is read from /etc/sysconfig/rasdaemon.
+-
+-The general format is environmentname=value.
++.SH FILES
++.B /etc/default/rasdaemon
+ 
+ .SH SEE ALSO
+ \fBras-mc-ctl\fR(8)
diff --git a/debian/patches/series b/debian/patches/series
index 763d6ea..bbea539 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ systemd-targets.patch
 add-man-options.patch
 systemd-requires.patch
 ras-mc-ctl.patch
+rasdaemon.8-config-path.patch
-- 
2.39.2

From d72612c57c3883588fd7c1cda9d4f2be899a5ece Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= 
Date: Wed, 14 Jun 2023 19:31:51 +0200
Subject: [PATCH 3/3] Fix empty line before heading in manuals
X-Mutt-PGP: OS

---
 debian/patches/manual-spacing-before-TH.patch | 26 +++
 debian/patches/series |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 debian/patches/manual-spacing-before-TH.patch

diff --git a/debian/patches/manual-spacing-before-TH.patch b/debian/patches/manual-spacing-before-TH.patch
new file mode 100644
index 000..14e3089
--- /dev/null
+++ b/debian/patches/manual-spacing-before-TH.patch
@@ -0,0 +1,26 @@
+diff --git a/man/ras-mc-ctl.8.in b/man/ras-mc-ctl.8.in
+index 54a8a3a..5a790f4 100644
+--- a/man/ras-mc-ctl.8.in
 b/man/ras-mc-ctl.8.in
+@@ -23,7 +23,7 @@
+ .\" with this program; if not, write to the Free Software Foundation, Inc.,
+ .\" 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ .\"
+-
++.
+ .TH RAS-MC-CTL 8 "@META_DATE@" "@META_ALIAS@" "RAS memory controller admin utility"
+ 
+ .SH NAME
+diff --git a/man/rasdaemon.8.in b/man/rasdaemon.8.in
+index 59affb4..1beff9c 100644
+--- a/man/rasdaemon.8.in
 b/man/rasdaemon.8.in
+@@ -17,7 +17,7 @@
+ .\" with this program; if not, write to the Free Software Foundation, Inc.,
+ .\" 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ .\"
+-
++.
+ .TH RASDAEMON 8 "@META_DATE@" "@META_ALIAS@" "RAS memory controller admin utility"
+ 
+ .SH NAME
diff 

Bug#1037952: rasdaemon(1) and /etc/default/rasdaemon point to /etc/sysconfig/rasdaemon which doesn't exist on Debian

2023-06-14 Thread наб
Package: rasdaemon
Version: 0.6.8-1.1
Severity: minor
Tags: patch

Dear Maintainer,

rasdaemon(8) says
  CONFIG FILE
 The rasdaemon program supports a config file to set rasdaemon systemd 
service environment variables. By default the config file is read from 
/etc/sysconfig/ras‐
 daemon.

 The general format is environmentname=value.
the weirdness of that aside, /etc/sysconfig/rasdaemon doesn't exist.
/etc/default/rasdaemon does, however, and says:
  # Page Isolation
  # Note: Run-time configuration is unsupported, service restart needed.
  # Note: this file should be installed at /etc/sysconfig/rasdaemon
  
  # Specify the threshold of isolating buggy pages.
  #
  # Format:
  #   [0-9]+[unit]
  # Notice: please make sure match this format, rasdaemon will use default 
value for exception input cases.
  #
  # Supported units:
  # PAGE_CE_REFRESH_CYCLE: D|d (day), H|h (hour), M|m (min), default is in hour
  # PAGE_CE_THRESHOLD: K|k (x1000), M|m (x1000k), default is none
  #
  # The two configs will only take no effect when PAGE_CE_ACTION is "off".
  PAGE_CE_REFRESH_CYCLE="24h"
  PAGE_CE_THRESHOLD="50"
  
  # Specify the internal action in rasdaemon to exceeding a page error 
threshold.
  #
  # off  no action
  # account  only account errors
  # soft try to soft-offline page without killing any processes
  #  This requires an uptodate kernel. Might not be successfull.
  # hard try to hard-offline page by killing processes
  #  Requires an uptodate kernel. Might not be successfull.
  # soft-then-hard   First try to soft offline, then try hard offlining.
  # Note: default offline choice is "soft".
  PAGE_CE_ACTION="soft"

Again, it shouldn't on Debian because the service says
  $ systemctl cat rasdaemon.service
  # /lib/systemd/system/rasdaemon.service
  [Unit]
  Description=RAS daemon to log the RAS events
  # only needed when not running in foreground (--foreground | -f)
  #After=syslog.target
  
  [Service]
  EnvironmentFile=/etc/default/rasdaemon
  ExecStart=/usr/sbin/rasdaemon -f -r
  ExecStartPost=/usr/sbin/rasdaemon --enable
  ExecStop=/usr/sbin/rasdaemon --disable
  Restart=on-abort
  
  [Install]
  WantedBy=multi-user.target

To that end, I'm attaching three patches (also at Salsa as
 https://salsa.debian.org/tai271828/rasdaemon-sandbox-01/-/merge_requests/1):
  * fixing /etc/default/rasdaemon
  * fixing rasdaemon(8) by replacing that whole section with
  .SH FILES
  .B /etc/default/rasdaemon
  * fixing rasdaemon(8) and ras-mc-ctl(8) by removing the empty line
from before .TH, which removes the empty line before the heading

-- System Information:
Debian Release: 12.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-9-amd64 (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages rasdaemon depends on:
ii  init-system-helpers  1.65.2
ii  libc62.36-9
ii  libdbd-sqlite3-perl  1.72-1
ii  libsqlite3-0 3.40.1-2
ii  perl 5.36.0-7
ii  sqlite3  3.40.1-2

rasdaemon recommends no packages.

rasdaemon suggests no packages.

-- no debconf information


signature.asc
Description: PGP signature