Bug 447973 - running ipa-server-install with bad options produces a 0 return code
running ipa-server-install with bad options produces a 0 return code
Status: CLOSED ERRATA
Product: freeIPA
Classification: Community
Component: ipa-server (Show other bugs)
unspecified
All Linux
high Severity medium
: ---
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks: 429034
  Show dependency treegraph
 
Reported: 2008-05-22 14:11 EDT by Michael Gregg
Modified: 2015-01-04 18:32 EST (History)
1 user (show)

See Also:
Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix up function return values so we can return 1 on an installation error. (3.94 KB, patch)
2008-05-22 15:20 EDT, Rob Crittenden
no flags Details | Diff

  None (edit)
Description Michael Gregg 2008-05-22 14:11:15 EDT
Description of problem:
running ipa-server-install with bad options produces a zero return code

Version-Release number of selected component (if applicable):
build from 5-22-08

How reproducible:
always

Steps to Reproduce:
1.run /usr/sbin/ipa-server-install -U --hostname=dhcp-114 -r SJCTEST.REDHAT.COM
-p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
2.
3.
  
Actual results:
ipa server install produces a error message, and exits with a 0 return code.

Expected results:
The return code to not be 0.

Additional info:
Comment 1 Rob Crittenden 2008-05-22 14:20:15 EDT
What is the bad option in this command-line? It looks ok to me. The hostname is
probably not going to work but that is not a bad option.
Comment 2 Michael Gregg 2008-05-22 14:47:57 EDT
The bad option is the hostname. It's not a full hostname. 

So when ipa-server-install hits a ERROR, I'd like to see a non-zero result. 


This is the current output of that string, notice the return code at the bottom:

[root@dhcp-114 tmp]# /usr/sbin/ipa-server-install -U --hostname=dhcp-114 -r
SJCTEST.REDHAT.COM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d

The log file for this installation can be found in /var/log/ipaserver-install.log
root        : DEBUG    Loading Index file from
'/var/lib/ipa/sysrestore/sysrestore.index'
==============================================================================
This program will setup the IPA Server.

This includes:
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure TurboGears

To accept the default shown in brackets, press the Enter key.

root        : DEBUG    Loading StateFile from
'/var/lib/ipa/sysrestore/sysrestore.state'
root        : DEBUG    Loading Index file from
'/var/lib/ipa/sysrestore/sysrestore.index'
root        : ERROR    Invalid hostname: dhcp-114



Return code:

[root@dhcp-114 tmp]# echo $?
0

Comment 3 Rob Crittenden 2008-05-22 15:20:51 EDT
Created attachment 306415 [details]
Fix up function return values so we can return 1 on an installation error.
Comment 4 Rob Crittenden 2008-05-22 16:38:04 EDT
ipa-1-0: 4a1862075e88cb48f226bb1c1b575e9484bdd845
master: 927447b144bbe0afd1d099a71dd482f61b431749
Comment 6 Michael Gregg 2008-11-19 19:21:32 EST
ipa-server-install -U --hostname=BOGUSNAME -r BOGUSRELM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
+ ssh root@ipaqa-64vm.dsqa.sjc2.redhat.com ipa-server-install -U --hostname=BOGUSNAME -r BOGUSRELM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
root        : DEBUG    Loading Index file from '/var/lib/ipa/sysrestore/sysrestore.index'

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will setup the IPA Server.

This includes:
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure TurboGears
  * Configure DNS (bind)

To accept the default shown in brackets, press the Enter key.

root        : ERROR    Invalid hostname: BOGUSNAME

+ ret=1


Verified against:
1.1.0-2.20081119.el5ipa

Note You need to log in before you can comment on or make changes to this bug.