all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager] pve7to8: fix broken pipe warning for dkms status invocation
Date: Fri, 28 Mar 2025 18:48:28 +0100	[thread overview]
Message-ID: <20250328174828.46006-1-c.ebner@proxmox.com> (raw)

The check for dkms kernel modules relies on the output of `dkms
status`. dkms command invocation will perform the following sanity
check:
```
if [ ! -e <(echo) ]; then
    warn $"dkms will not function properly if /proc is not mounted."
fi
```

This check will however throw the following warning when SIGPIPE is
set to be ignored:

```
sbin/dkms: line 2497: echo: write error: Broken pipe
```

While only cosmetic, this can be confusing. Therefore, temporarily
enable SIGPIPE before calling dkms, restoring the originally setting
afterwards.

Reported-by: Alexander Zeidler <a.zeidler@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 PVE/CLI/pve7to8.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index 416ec79b..61710178 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -1356,9 +1356,12 @@ sub check_dkms_modules {
 	$count = scalar @_;
     };
 
+    my $sig_pipe = $SIG{PIPE};
+    $SIG{PIPE} = "DEFAULT";
     my $exit_code = eval {
 	run_command(['dkms', 'status', '-k', '`uname -r`'], outfunc => $set_count, noerr => 1)
     };
+    $SIG{PIPE} = $sig_pipe;
 
     if ($exit_code != 0) {
 	log_skip("could not get dkms status");
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-03-28 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 17:48 Christian Ebner [this message]
2025-04-04 10:50 ` [pve-devel] applied: " Thomas Lamprecht

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=20250328174828.46006-1-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal