Bug #21530 ndb_mgm does not set the exit status on errors
Submitted: 9 Aug 2006 10:24 Modified: 2 Nov 2006 9:25
Reporter: Hartmut Holzgraefe
Status: Closed
Category:Server: Cluster Severity:S3 (Non-critical)
Version:4.1, 5.0, 5.1 OS:
Assigned to: Guangbao Ni Target Version:

[9 Aug 2006 10:24] Hartmut Holzgraefe
Description:
The ndb_mgm management client does not set the exit status on errors, makeing it almost
useless for any kind of shell script automation like e.g. init scripts

How to repeat:
$ ndb_mgm -e foobar; echo "exit status: $?"
Unable to connect with connect string: nodeid=0,localhost:1186
Retrying every 5 seconds. Attempts left: 2 1, failed.
exit status: 0

$ ndb_mgm -e foobar; echo "exit status: $?"
Connected to Management Server at: localhost:1186
Invalid command: foobar
Type HELP for help.
exit status: 0

$ ndb_mgm -e "1 start"; echo "exit status: $?"
Connected to Management Server at: localhost:1186
Start failed.
*    22: Error
*        The process has wrong type. Expected a DB process.
exit status: 0
[8 Sep 2006 3:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/11587

ChangeSet@1.2534, 2006-09-07 20:50:33+08:00, gni@dev3-127.(none) +1 -0
  BUG#21530 The ndb_mgm management client doesn't set the exit status on errors, 
            making it almost useless for any kind of shell script automation.
            Now add the return value that indicates the excution 
            whether or not success for many methods.
[8 Sep 2006 3:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/11588

ChangeSet@1.2533, 2006-09-08 09:22:46+08:00, gni@dev3-127.(none) +1 -0
  BUG#21530 The ndb_mgm management client doesn't set the exit status on errors, 
            making it almost useless for any kind of shell script automation.
            Now add the return value that indicates the excution 
            whether or not success for many methods.
[15 Sep 2006 14:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/12007

ChangeSet@1.2534, 2006-09-15 20:04:59+08:00, gni@dev3-127.(none) +1 -0
  BUG#21530 The ndb_mgm management client doesn't set the exit status on errors, making it

            almost useless for any kind of shell script automation.
            Now add the return value that indicates the execution whether or not success 
            for many methods.
[10 Oct 2006 20:38] Jonas Oreland
pushed into 5.1.12
[1 Nov 2006 15:27] Jonas Oreland
pushed into 4.1.22
[1 Nov 2006 15:42] Jonas Oreland
pushed into 5.0.29
[2 Nov 2006 9:25] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of
that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version,
including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix for 4.1.22/5.0.29/5.1.12.
[4 Nov 2006 4:21] Jon Stephens
*Fix for 5.0 documented in 5.0.30 Release Notes.*