[pve-devel] [PATCH pve-manager] pve7to8: fix broken pipe warning for dkms status invocation
Christian Ebner
c.ebner at proxmox.com
Fri Mar 28 18:48:28 CET 2025
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 at proxmox.com>
Signed-off-by: Christian Ebner <c.ebner at 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
More information about the pve-devel
mailing list