Bug 798281

Summary: pulp-cds rc service doesn't support status call
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: mkovacik
Component: CDSAssignee: wes hayutin <whayutin>
Status: CLOSED ERRATA QA Contact: Martin Kočí <mkoci>
Severity: low Docs Contact:
Priority: high    
Version: 2.1CC: achan, jslagle, kbidarka, mkoci, sghai, tsanders
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When executing 'service pulp-cds status', syntax usage errors appeared. This update adds a status call to the 'pulp-cds' init script. 'service pulp-cds status' should now output the correct status message.
Story Points: ---
Clone Of:
: 819988 (view as bug list) Environment:
Last Closed: 2012-08-24 11:53:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 819988    
Bug Blocks:    
Attachments:
Description Flags
Disproving screen log none

Description mkovacik 2012-02-28 14:19:08 UTC
Description of problem:
As stated in the summary, the pulp-cds service doesn't support the status call.

Version-Release number of selected component (if applicable):
RHEL 6.2, RHEL-6.2-RHUI-2.0.2-20120224.0-Server-x86_64-DVD1.iso

How reproducible:
Always

Steps to Reproduce:
1. Deploy a rhui setup
2. service pulp-cds status
3. pulp-cds service complains about usage
  
Expected results:
pulp-cds service should provide its status upon request

Additional info:
# Screenlog
# =========

[root@ip-10-53-142-113 ~]# service pulp-cds status
Usage: pulp-cds {start|stop|restart}

Comment 1 Todd Sanders 2012-03-02 13:27:01 UTC
Moving to v2.1

Comment 2 wes hayutin 2012-05-21 21:58:20 UTC
pulp commit 7a036b0cba2321c446ab4cdeb7f35ae5e35d76b2

checked the service script for pulp, and looked at 
http://fedoraproject.org/wiki/Packaging:SysVInitScript#status_function

This isn't the prettiest way to do it, but it looks like that is the standard.

Comment 3 wes hayutin 2012-05-21 21:59:04 UTC
test

[root@ip-10-46-138-32 ~]# /etc/init.d/pulp-cds
Usage: pulp-cds {start|stop|restart|status}
[root@ip-10-46-138-32 ~]# /etc/init.d/pulp-cds stop
Stopping httpd:                                            [  OK  ]
Stopping goferd                                            [  OK  ]
[root@ip-10-46-138-32 ~]# /etc/init.d/pulp-cds start
Starting goferd                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@ip-10-46-138-32 ~]# /etc/init.d/pulp-cds restart
Stopping httpd:                                            [  OK  ]
Stopping goferd                                            [  OK  ]
Starting goferd                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@ip-10-46-138-32 ~]# /etc/init.d/pulp-cds status
httpd (pid  29536) is running...
goferd (29524) is running.

Comment 4 mkovacik 2012-07-19 11:26:09 UTC
Created attachment 599116 [details]
Disproving screen log

Seems this commit didn't make it to the build: http://download.lab.bos.redhat.com/devel/candidate-trees/RHEL-6.3-RHUI-2.1-20120705.0/2.1.3/Server/x86_64/os/Packages/...

Comment 5 mkovacik 2012-07-19 11:33:05 UTC
Switching to assigned based on comment 4...

Comment 6 wes hayutin 2012-07-19 14:39:15 UTC
commit d35bf30e11a638bacb159cb457137662ac2184ed
Author: wes hayutin <whayutin>
Date:   Mon May 21 17:55:23 2012 -0400

    bz 798281 add status call to service pulp-cds

diff --git a/etc/rc.d/init.d/pulp-cds b/etc/rc.d/init.d/pulp-cds
index 700938a..b18cbe5 100644
--- a/etc/rc.d/init.d/pulp-cds
+++ b/etc/rc.d/init.d/pulp-cds
@@ -31,10 +31,20 @@ stop() {
     return $RETVAL
 }
 
+status() {
+    $SERVICE httpd status || RETVAL=$?
+    [ $RETVAL = 0 ] && $SERVICE goferd status || RETVAL=$?
+    [ $RETVAL = 0 ]
+    return $RETVAL
+}
+
 case "$1" in
     start)
         start
         ;;
+    status)
+        status
+        ;;
     stop)
         stop
         ;;
@@ -43,7 +53,7 @@ case "$1" in
         start
         ;;
     *)
-        echo $"Usage: pulp-cds {start|stop|restart}"
+        echo $"Usage: pulp-cds {start|stop|restart|status}"
         RETVAL=3
 esac

Comment 7 Martin Kočí 2012-08-03 11:17:22 UTC
Reproduced the issue and checked agains the latest version.

/root/RHEL-6.3-RHUI-2.1-20120705.0-Server-x86_64-DVD1.iso on /tmp/mnt type iso9660 (rw,loop=/dev/loop0)
[root@ip-10-2-39-233 ~]# service pulp-cds status
Usage: pulp-cds {start|stop|restart}



/root/RHEL-6.3-RHUI-2.1-20120801.0-Server-x86_64-DVD1.iso on /tmp/mnt type iso9660 (rw,loop=/dev/loop0)
[root@ip-10-140-5-81 ~]# service pulp-cds status
httpd (pid  28619) is running...
goferd (28576) is running.

Moving bug to VERIFIED.

Comment 8 Athene Chan 2012-08-14 05:10:46 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When executing 'service pulp-cds status', syntax usage errors appeared. This update adds a status call to the 'pulp-cds' init script. 'service pulp-cds status' should now output the correct status message.

Comment 10 errata-xmlrpc 2012-08-24 11:53:30 UTC
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/RHEA-2012-1205.html