Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 617305

Summary: db-control returns 1 on success
Product: Red Hat Satellite 5 Reporter: Rob Marti <robmartiwork>
Component: UsabilityAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED ERRATA QA Contact: Jiri Kastner <jkastner>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, jhutar, jkastner, jpazdziora, mmraka, psklenar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-web-1.2.7-9 Doc Type: Bug Fix
Doc Text:
When running db-control with the "start" or "stop" command, the utility incorrectly returned 1, even though the operation actually succeeded. This error no longer occurs, and the db-control utility now always returns a proper exit status.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-21 12:25:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 462714    

Description Rob Marti 2010-07-22 18:29:31 UTC
Description of problem:
running db-control stop and db-control start return 1 on success instead of 0

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. run db-control stop
2. echo $? and receive a 1 as output
  
Actual results:
-bash-3.2$ db-control stop && db-control backup . && db-control start
Shutting down database... done.
-bash-3.2$ echo $?
1
-bash-3.2$ db-control backup .
Initiating cold backup of database rhnsat...
  /opt/apps/oracle/config/10.2.0/lkRHNSAT -> ./lkRHNSAT.gz ... done.
... output snipped ...
  /rhnsat/data/rhnsat/data_02.dbf -> ./data_02.dbf.gz ... done.
Full cold backup complete.
-bash-3.2$ echo $?
0
-bash-3.2$ db-control start
Starting database... done.
-bash-3.2$ echo $?
1
-bash-3.2$ 


Expected results:
-bash-3.2$ db-control stop && db-control backup . && db-control start
Shutting down database... done.
Initiating cold backup of database rhnsat...
  /opt/apps/oracle/config/10.2.0/lkRHNSAT -> ./lkRHNSAT.gz ... done.
... output snipped ...
  /rhnsat/data/rhnsat/data_02.dbf -> ./data_02.dbf.gz ... done.
Full cold backup complete.
Starting database... done.
-bash-3.2$ echo $?
0
-bash-3.2$

Additional info:

Comment 2 Jan Pazdziora (Red Hat) 2010-12-10 21:07:05 UTC
Taking.

Comment 3 Jan Pazdziora (Red Hat) 2010-12-10 21:08:51 UTC
*** Bug 527200 has been marked as a duplicate of this bug. ***

Comment 4 Jan Pazdziora (Red Hat) 2010-12-10 21:12:16 UTC
Fixed in Spacewalk master, 23d89f5b302f2a0ed55249f2cfd0b6be2e31f74d.

Comment 5 Michael Mráka 2010-12-13 09:33:19 UTC
Cherry picked to SATELLITE-5.4 as
commit 5d457754dad8444f04b034b1e9f0d3788ca3335c
    617305 - make sure exit value 0 is returned by all db-control commands by default.
    Without explicit return 0, the result of last command is returned,
    which for print is generaly 1.
    (cherry picked from commit 23d89f5b302f2a0ed55249f2cfd0b6be2e31f74d)

Comment 10 Jan Pazdziora (Red Hat) 2010-12-15 10:56:07 UTC
The db-control status returns 0 when the database is running. Since you've initiated stop, it's correct that it does not return 0.

Moving back to ON_QA.

Comment 12 Jaromir Hradilek 2010-12-16 10:43:56 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 running db-control with the "start" or "stop" command, the utility incorrectly returned 1 (operation not permitted), even though the operation actually succeeded. This error no longer occurs, and the db-control utility now always returns a proper exit status.

Comment 13 Jaromir Hradilek 2010-12-16 10:58:55 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When running db-control with the "start" or "stop" command, the utility incorrectly returned 1 (operation not permitted), even though the operation actually succeeded. This error no longer occurs, and the db-control utility now always returns a proper exit status.+When running db-control with the "start" or "stop" command, the utility incorrectly returned 1, even though the operation actually succeeded. This error no longer occurs, and the db-control utility now always returns a proper exit status.

Comment 15 errata-xmlrpc 2010-12-21 12:25:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-1001.html

Comment 16 Miroslav Suchý 2012-03-23 12:41:34 UTC
*** Bug 673049 has been marked as a duplicate of this bug. ***