From 5329969fd038ed7db9bd1b6ba4550f8f430858f1 Mon Sep 17 00:00:00 2001 From: Papan Kumar Singh Date: Tue, 16 Nov 2021 11:48:18 +0530 Subject: [PATCH] EOS-25693-new: Support Bundle generation is not creating and collecting data for m0reportbug-traces. (#1221) Fix : If /proc/sysrq-trigger is mounted as ro then return. Signed-off-by: Papan Kumar Singh --- utils/m0reportbug | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/m0reportbug b/utils/m0reportbug index 3570796d6ee..fe9d86280ae 100755 --- a/utils/m0reportbug +++ b/utils/m0reportbug @@ -418,6 +418,10 @@ _path_rpm() { case $name in m0d|m0trace|m0tracedump) echo "/usr/bin/$name";; + m0cp) echo "/usr/bin/$name";; + m0client) echo "/usr/bin/$name";; + m0touch) echo "/usr/bin/$name";; + m0cat) echo "/usr/bin/$name";; m0mkfs) echo "/usr/sbin/$name";; m0addb2dump) echo "/usr/sbin/$name";; m0beck|m0betool) echo "/usr/sbin/$name";; @@ -699,6 +703,13 @@ sysrq_info() { [t]='show-task-states' [m]='show-memory-usage' ) + + local fs_access=$(cat /proc/mounts | grep /proc/sysrq-trigger | awk '{print substr($4,1,2)}') + if [[ "ro" == "$fs_access" ]] ; then + warn "/proc/sysrq-trigger is read-only. Won't be able to collect system information." + return 0 + fi + local old_sysrq=$(sysctl --values kernel.sysrq) # unmask all sysrq functions