Bug 1124497

Summary: /etc/rc.d/init.d/netconsole doesn't check for /proc/modules
Product: Red Hat Enterprise Linux 7 Reporter: felix.krohn
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: lnykryn
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-18 08:46:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
adds a check for /proc/modules before the lsmod invocation in status() none

Description felix.krohn 2014-07-29 15:50:51 UTC
Description of problem:
When a (non-RHEL) non-modular kernel is booted, "service --status-all" yields an error:

# service --status-all
libkmod: kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory
netconsole module not loaded
Configured devices:
lo eth0
Currently active devices:
lo eth0


Source of the problem is in /etc/rc.d/init.d/netconsole, line 110, function status(): lsmod is executed without checking if /proc/modules exists beforehand.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. boot a non-modular kernel
2. # service --status-all
3.

Actual results:
Error

Expected results:
no Error

Additional info:

Comment 2 felix.krohn 2014-07-29 17:16:09 UTC
Created attachment 922237 [details]
adds a check for /proc/modules before the lsmod invocation in status()

minimal patch

Comment 3 Lukáš Nykrýn 2014-07-30 06:48:44 UTC
At beginning I must note that we do not support non-RHEL kernels.

And also there should be something like
+        else
+                echo $"/proc/modules does not exists"
+                RETVAL=3

because otherwise you will get false return value.


But the main reason why I want to close this as notabug is that it yields that there is an error because there is one.