portreserve returns wrong number for status

Solution Verified - Updated -

Issue

  • The return codes for the status function return inconsistent error codes to the shell.
  • sshd IS running and the return code to the shell of 'service sshd status' is 0. This is OK and seems to be the convention Red Hat has generally stuck with.
root@puppet-rhel6-dev /home/puppet# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
root@puppet-rhel6-dev /home/puppet# service sshd status
openssh-daemon (pid  1360) is running...
root@puppet-rhel6-dev /home/puppet# echo $?
0
  • 'service portreserve status' returns 0 even it doesn't running
root@puppet-rhel6-dev /home/puppet# service portreserve stop
Stopping portreserve:
root@puppet-rhel6-dev /home/puppet# service portreserve status
portreserve is stopped
root@puppet-rhel6-dev /home/puppet# echo $?
0
  • It should return 3 instead of 0

Environment

  • Red Hat Enterprise Linux 6.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.