RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 988887 - lm_sensors init script doesn't return 3 on status when stopped
Summary: lm_sensors init script doesn't return 3 on status when stopped
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lm_sensors
Version: 6.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Martin Sehnoutka
QA Contact: William Gomeringer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-26 15:42 UTC by John Brier
Modified: 2016-08-17 07:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-17 07:41:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Brier 2013-07-26 15:42:00 UTC
Description of problem:

# service lm_sensors stop
Stopping lm_sensors: [  OK  ]
# echo $?
0

https://fedoraproject.org/wiki/Packaging:SysVInitScript?rd=Packaging/SysVInitScript#Exit_Codes_for_the_Status_Action

if it's stopped it should return 3, not 0 

If this is expected or unique because lm_sensors technically isn't a service but just a script to load/unload modules, please confirm or clarify.

Version-Release number of selected component (if applicable):
lm_sensors-3.1.1-17.el6.x86_64


How reproducible:
100 %

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

I saw in Bug 575757 Comment 10 a suggestion to stop testing lm_sensors init script since upstream dropped it in favor of the sensord init script, but I don't see that reflected in F18 and from what I understand the scripts serve unique purposes, sensord being used to log data on sensor information regularly.

Comment 2 Jaromír Cápík 2013-07-26 16:22:11 UTC
Hello John.

The zero exitcode is correct. Non-zero exitcodes are only returned when you ask for status.

Try this:

service lm_sensors stop
service lm_sensors status

You should get 3 ...

Please, check that and let me know.

Thanks,
Jaromir.

Comment 3 John Brier 2013-07-26 16:52:25 UTC
(In reply to Jaromír Cápík from comment #2)
> Hello John.
> 
> The zero exitcode is correct. Non-zero exitcodes are only returned when you
> ask for status.
> 
> Try this:
> 
> service lm_sensors stop
> service lm_sensors status
> 
> You should get 3 ...
> 
> Please, check that and let me know.
> 
> Thanks,
> Jaromir.

oops. I didn't do my example right.

# service lm_sensors stop
Stopping lm_sensors: [  OK  ]
# service lm_sensors status
acpitz-virtual-0
Adapter: Virtual device
temp1:       +30.0°C  (crit = +105.0°C)                  
temp2:       +30.0°C  (crit = +105.0°C)                  

# echo $?
0

Comment 4 Jaromír Cápík 2013-07-26 17:27:02 UTC
Ok ... now it really seems to be a problem of the init script.
The problem only appears in some cases as it depends on the sensors available on the testing hardware.
The init script needs to be redesigned. It doesn't check for the status of sensor modules, it simply checks for the success of the sensors command. But as some of the sensors might work even without modules, the sensors command can return zero status even when all the modules defined in /etc/sysconfig/lm_sensors file are unloaded.
It's questionable if that can still be considered a running service or not.
In fact the only purpose of the init script is to load the modules. So, if we look at the init script as if it was a module loader only, then it doesn't work correctly, because it returns 0 even when all the modules loaded with service lm_sensors start are unloaded.

Comment 5 John Brier 2013-07-26 18:49:00 UTC
In Bug 575757 Comment 0 the following issues were pointed out, which still exist in lm_sensors-3.1.1-17.el6.x86_64

=== 1 ===
:: [   FAIL   ] :: Running 'grep -i "usage.*force-reload" /etc/init.d/lm_sensors' (Expected 0, got 1)
	echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"

-> Add force-reload action even if it would be same as 'restart'.

=== 2 ===
Usage: /etc/init.d/lm_sensors {start|stop|status|restart|reload|condrestart}
:: [   FAIL   ] :: Running 'service lm_sensors' (Expected 2, got 3)

-> Running with invalid argument (such as blank one) should exit with exit code = 2 not 3. See https://fedoraproject.org/wiki/Packaging/SysVInitScript#Exit_Codes_for_non-Status_Actions

=== 3 ===
:: [   PASS   ] :: Running 'touch /var/lock/subsys/lm_sensors'
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
:: [   FAIL   ] :: Running 'service lm_sensors status' (Expected 2, got 3)

-> It should say, e.g: "lm_sensors dead but subsys locked" and exit with ec=2.


Since lm_sensors isn't a real service I'm not sure if the third issue is something we should check for. Should we?

Comment 7 RHEL Program Management 2013-10-13 23:20:10 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 10 Tomáš Hozza 2016-08-17 07:41:52 UTC
Red Hat Enterprise Linux version 6 is entering the Production 2 phase of its lifetime and this bug doesn't meet the criteria for it, i.e. only high severity issues will be fixed. Please see https://access.redhat.com/support/policy/updates/errata/ for further information.

This issue is not being tracked for newer RHEL, because init scripts are not used any more.


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