Bug 707133

Summary: Successful "ipa-nis-manage enable" command has exit status as 1.
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: low Docs Contact:
Priority: low    
Version: 6.1CC: benl, dpal, jgalipea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.1.0-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: The ipa-nis-manage command doesn't return 0 on success. Consequence: It is not possible to script the command and rely on the return value to determine success/failure. Fix: Handle the case where it has never been enabled from it has been enabled but is currently disabled. We were doing too much work in the latter case causing the invalid return value. Result: Return 0 on success and 1 on failure as documented.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:22:36 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:

Description Gowrishankar Rajaiyan 2011-05-24 07:36:41 UTC
Description of problem:


Version-Release number of selected component (if applicable):
[root@bumblebee ~]# rpm -qi ipa-server | head
Name        : ipa-server                   Relocations: (not relocatable)
Version     : 2.0.0                             Vendor: Red Hat, Inc.
Release     : 23.el6                        Build Date: Wed 20 Apr 2011 09:57:13 AM EDT
Install Date: Wed 18 May 2011 09:14:40 AM EDT      Build Host: x86-003.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: ipa-2.0.0-23.el6.src.rpm
Size        : 2565882                          License: GPLv3+
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.freeipa.org/
Summary     : The IPA authentication server


How reproducible:
Always

Steps to Reproduce:
1. ipa-nis-manage enable
2. Enter directory server password

  
Actual results:
[root@bumblebee ]# ipa-nis-manage enable
Directory Manager password: 

Enabling plugin
[root@bumblebee ]# echo $?
1
[root@bumblebee ]# 


Expected results:
EXIT STATUS
       0 if the command was successful


Additional info:
[root@bumblebee ~]# ipa-nis-manage -d enable
Directory Manager password: 

DEBUG importing all plugin modules in '/usr/lib/python2.6/site-packages/ipalib/plugins'...
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/aci.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/automount.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/batch.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/cert.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/config.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/delegation.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/dns.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/entitle.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/group.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/hbacrule.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/hbacsvc.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/hbacsvcgroup.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/host.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/internal.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/kerberos.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/krbtpolicy.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/migration.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/misc.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/netgroup.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/permission.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/ping.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/privilege.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/pwpolicy.py'
DEBUG args=klist -V
DEBUG stdout=Kerberos 5 version 1.9

DEBUG stderr=
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/role.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/selfservice.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/service.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/sudocmd.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/sudocmdgroup.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/sudorule.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/user.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/virtual.py'
DEBUG importing plugin module '/usr/lib/python2.6/site-packages/ipalib/plugins/xmlclient.py'
DEBUG Created connection context.ldap2_42048784
DEBUG args=/sbin/chkconfig portmap on
DEBUG stdout=
DEBUG stderr=error reading information on service portmap: No such file or directory

DEBUG args=/sbin/chkconfig rpcbind on
DEBUG stdout=
DEBUG stderr=
Enabling plugin
INFO Parsing file /usr/share/ipa/nis.uldif
INFO Updating existing entry: cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: cn=NIS Server,cn=plugins,cn=config
DEBUG nsslapd-pluginid: nis-plugin
DEBUG cn: NIS Server
DEBUG nis-tcp-wrappers-name: nis-server
DEBUG objectclass: 
DEBUG 	top
DEBUG 	nsSlapdPlugin
DEBUG 	extensibleObject
DEBUG nsslapd-plugindescription: NIS Server Plugin
DEBUG nsslapd-pluginenabled: off
DEBUG nsslapd-pluginpath: /usr/lib64/dirsrv/plugins/nisserver-plugin.so
DEBUG nsslapd-pluginversion: 0.23
DEBUG nsslapd-pluginvendor: redhat.com
DEBUG nsslapd-plugintype: object
DEBUG nsslapd-plugininitfunc: nis_plugin_init
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: cn=NIS Server,cn=plugins,cn=config
DEBUG nsslapd-pluginid: nis-plugin
DEBUG cn: NIS Server
DEBUG nis-tcp-wrappers-name: nis-server
DEBUG objectclass: 
DEBUG 	top
DEBUG 	nsSlapdPlugin
DEBUG 	extensibleObject
DEBUG nsslapd-plugindescription: NIS Server Plugin
DEBUG nsslapd-pluginenabled: off
DEBUG nsslapd-pluginpath: /usr/lib64/dirsrv/plugins/nisserver-plugin.so
DEBUG nsslapd-pluginversion: 0.23
DEBUG nsslapd-pluginvendor: redhat.com
DEBUG nsslapd-plugintype: object
DEBUG nsslapd-plugininitfunc: nis_plugin_init
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: passwd.byname
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: passwd.byname
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byuid,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byuid,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: passwd.byuid
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=passwd.byuid,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: passwd.byuid
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: group.byname
DEBUG nis-base: cn=groups, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: group.byname
DEBUG nis-base: cn=groups, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.bygid,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.bygid,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: group.bygid
DEBUG nis-base: cn=groups, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=group.bygid,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: group.bygid
DEBUG nis-base: cn=groups, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=netid.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=netid.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: netid.byname
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=netid.byname,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-map: netid.byname
DEBUG nis-base: cn=users, cn=accounts, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG nis-secure: no
DEBUG []
DEBUG Live 1, updated 0
INFO Done
INFO Updating existing entry: nis-domain=lab.eng.pnq.redhat.com+nis-map=netgroup,cn=NIS Server,cn=plugins,cn=config
DEBUG ---------------------------------------------
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=netgroup,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-value-format: %merge(" ","%{memberNisNetgroup}","(%link(\"%ifeq(\\\"hostCategory\\\",\\\"all\\\",\\\"\\\",\\\"%collect(\\\\\\\"%{externalHost}\\\\\\\",\\\\\\\"%deref(\\\\\\\\\\\\\\\"memberHost\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\",\\\\\\\"%deref_r(\\\\\\\\\\\\\\\"member\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\",\\\\\\\"%deref_r(\\\\\\\\\\\\\\\"memberHost\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"member\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\")\\\")\",\"-\",\",\",\"%ifeq(\\\"userCategory\\\",\\\"all\\\",\\\"\\\",\\\"%collect(\\\"%deref(\\\\\\\"memberUser\\\\\\\",\\\\\\\"uid\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"member\\\\\\\",\\\\\\\"uid\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"memberUser\\\\\\\",\\\\\\\"member\\\\\\\",\\\\\\\"uid\\\\\\\")\\\")\\\")\",\"-\"),%{nisDomainName:-})")
DEBUG nis-key-format: %{cn}
DEBUG nis-map: netgroup
DEBUG nis-filter: (objectClass=ipanisNetgroup)
DEBUG nis-base: cn=ng, cn=alt, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-secure: no
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG ---------------------------------------------
DEBUG Final value
DEBUG dn: nis-domain=lab.eng.pnq.redhat.com+nis-map=netgroup,cn=NIS Server,cn=plugins,cn=config
DEBUG objectclass: 
DEBUG 	top
DEBUG 	extensibleObject
DEBUG nis-value-format: %merge(" ","%{memberNisNetgroup}","(%link(\"%ifeq(\\\"hostCategory\\\",\\\"all\\\",\\\"\\\",\\\"%collect(\\\\\\\"%{externalHost}\\\\\\\",\\\\\\\"%deref(\\\\\\\\\\\\\\\"memberHost\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\",\\\\\\\"%deref_r(\\\\\\\\\\\\\\\"member\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\",\\\\\\\"%deref_r(\\\\\\\\\\\\\\\"memberHost\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"member\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"fqdn\\\\\\\\\\\\\\\")\\\\\\\")\\\")\",\"-\",\",\",\"%ifeq(\\\"userCategory\\\",\\\"all\\\",\\\"\\\",\\\"%collect(\\\"%deref(\\\\\\\"memberUser\\\\\\\",\\\\\\\"uid\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"member\\\\\\\",\\\\\\\"uid\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"memberUser\\\\\\\",\\\\\\\"member\\\\\\\",\\\\\\\"uid\\\\\\\")\\\")\\\")\",\"-\"),%{nisDomainName:-})")
DEBUG nis-key-format: %{cn}
DEBUG nis-map: netgroup
DEBUG nis-filter: (objectClass=ipanisNetgroup)
DEBUG nis-base: cn=ng, cn=alt, dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com
DEBUG nis-secure: no
DEBUG nis-domain: lab.eng.pnq.redhat.com
DEBUG []
DEBUG Live 1, updated 0
INFO Done
DEBUG Destroyed connection context.ldap2_42048784
[root@bumblebee ~]# echo $?
1
[root@bumblebee ~]#

Comment 2 Dmitri Pal 2011-05-24 13:28:41 UTC
https://fedorahosted.org/freeipa/ticket/1247

Comment 3 Rob Crittenden 2011-08-01 20:33:40 UTC
master: 5f0adc3fbe5b193a57b05eed70b9f59463d9d9da

ipa-2-0: 01eec29431086c11f209fc1f69380d3b8fae36f3

Comment 5 Jenny Severance 2011-10-05 18:18:08 UTC
verified:

ipa-server-2.1.1-4.el6.x86_64

# ipa-nis-manage enable
Directory Manager password: 

Enabling plugin
This setting will not take effect until you restart Directory Server.
The rpcbind service may need to be started.

# echo $?
0


# ipa-nis-manage enable
Directory Manager password: 

Incorrect password
# echo $?
1

Comment 6 Rob Crittenden 2011-10-31 18:55:10 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:
Cause: The ipa-nis-manage command doesn't return 0 on success.
Consequence: It is not possible to script the command and rely on the return value to determine success/failure.
Fix: Handle the case where it has never been enabled from it has been enabled but is currently disabled. We were doing too much work in the latter case causing the invalid return value.
Result: Return 0 on success and 1 on failure as documented.

Comment 7 errata-xmlrpc 2011-12-06 18:22:36 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/RHSA-2011-1533.html