From: Sergio Gelato <sergio.gelato@astro.su.se>
To: linux-edac@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: PATCH: rasdaemon: Don't run ipmitool if use_ipmitool is false (#241)
Date: Thu, 23 Jul 2026 09:41:58 +0200 [thread overview]
Message-ID: <amHFxtiMSlRHBnxn@astro.su.se> (raw)
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
The patch below addresses an issue observed on some systems, where rasdaemon
(and sh) would log a failure to invoke ipmitool. The issue has been reported
before (https://github.com/mchehab/rasdaemon/issues/241) by someone else but
is still not fixed in release 0.8.5.
[-- Attachment #2: 0001-Don-t-run-ipmitool-if-use_ipmitool-is-false.patch --]
[-- Type: text/x-diff, Size: 1918 bytes --]
From: Sergio Gelato <Sergio.Gelato@astro.su.se>
Date: Wed, 22 Jul 2026 11:17:12 +0200
Subject: Don't run ipmitool if use_ipmitool is false
It's inappropriate to try and invoke ipmitool when use_ipmitool is false.
This has been observed to cause spurious warnings on systems where ipmitool
is not installed, and may have worse effects where it is.
Signed-off-by: Sergio Gelato <Sergio.Gelato@astro.su.se>
diff --git a/ras-aer-handler.c b/ras-aer-handler.c
index 5d069f3..85d3df7 100644
--- a/ras-aer-handler.c
+++ b/ras-aer-handler.c
@@ -187,21 +187,23 @@ int ras_aer_event_handler(struct trace_seq *s,
* number, byte 16[7:3] is device number, byte 16[2:0] is
* function number
*/
- rc = sscanf(ev.dev_name, "%x:%x:%x.%x", &seg, &bus, &dev, &fn);
- if (rc == 4) {
- sel_data[1] = seg & 0xff;
- sel_data[2] = (seg & 0xff00) >> 8;
- sel_data[3] = bus;
- sel_data[4] = (((dev & 0x1f) << 3) | (fn & 0x7));
-
- snprintf(ipmi_add_sel, sizeof(ipmi_add_sel),
- "ipmitool raw 0x0a 0x44 0x00 0x00 0xc0 0x00 0x00 0x00 0x00 0x3a 0xcd 0x00 0xc0 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
- sel_data[0], sel_data[1], sel_data[2], sel_data[3], sel_data[4]);
-
- rc = system(ipmi_add_sel);
+ if (use_ipmitool) {
+ rc = sscanf(ev.dev_name, "%x:%x:%x.%x", &seg, &bus, &dev, &fn);
+ if (rc == 4) {
+ sel_data[1] = seg & 0xff;
+ sel_data[2] = (seg & 0xff00) >> 8;
+ sel_data[3] = bus;
+ sel_data[4] = (((dev & 0x1f) << 3) | (fn & 0x7));
+
+ snprintf(ipmi_add_sel, sizeof(ipmi_add_sel),
+ "ipmitool raw 0x0a 0x44 0x00 0x00 0xc0 0x00 0x00 0x00 0x00 0x3a 0xcd 0x00 0xc0 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
+ sel_data[0], sel_data[1], sel_data[2], sel_data[3], sel_data[4]);
+
+ rc = system(ipmi_add_sel);
+ }
+ if (rc)
+ log(SYSLOG, LOG_WARNING, "Failed to execute ipmitool\n");
}
- if (rc)
- log(SYSLOG, LOG_WARNING, "Failed to execute ipmitool\n");
#endif
#ifdef HAVE_OPENBMC_UNIFIED_SEL
reply other threads:[~2026-07-23 7:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amHFxtiMSlRHBnxn@astro.su.se \
--to=sergio.gelato@astro.su.se \
--cc=linux-edac@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox