Bug 1124497 - /etc/rc.d/init.d/netconsole doesn't check for /proc/modules
Summary: /etc/rc.d/init.d/netconsole doesn't check for /proc/modules
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: initscripts
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-29 15:50 UTC by felix.krohn
Modified: 2016-11-25 13:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-18 08:46:45 UTC

Attachments (Terms of Use)
adds a check for /proc/modules before the lsmod invocation in status() (558 bytes, patch)
2014-07-29 17:16 UTC, felix.krohn
no flags Details | Diff

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:

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

Actual results:

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.

Note You need to log in before you can comment on or make changes to this bug.