Description of problem:
We have a small problem with the return code of the init script of the subscription-manager package which is incorrect. If you do a /etc/init.d/rhsmcertd status, the return code is 0 even if the service is stopped. For other init script I can see that status return 0 when the service is running and another value when it's not.
[root@sv0287 ~]# /etc/init.d/rhsmcertd status
rhsmcertd is stopped
[root@sv0287 ~]# echo $?
0
[root@sv0287 ~]# /etc/init.d/cpuspeed status
cpuspeed is stopped
[root@sv0287 ~]# echo $?
3
According to the Linux standard base (lsb), the sevice xxx status command exit status should have the following meanings:
0 program is running or service is OK
1 program is dead and /var/run pid file exists
2 program is dead and /var/lock lock file exists
3 program is not running
4 program or service status is unknown
Version-Release number of selected component (if applicable):
subscription-manager-0.96.17-1.el6.x86_64
How reproducible:
Always
Steps to Reproduce:
1. service rhsmcertd stop
2. service rhsmcertd status
3. Returns 0 even though the service is not running
Actual results:
service rhsmcertd status returns 0 when the program isn't running
Expected results:
service rhsmcertd status returns 3 when the program isn't running
Additional info:
Happens with rhsmcertd on RHEL5 as well, but I haven't created a separate bug for it.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-0033.html