Bug 486474

Summary: overriding arguments to setup causes setup to fail
Product: Red Hat Directory Server Reporter: Ulf Weltman <ulf.weltman>
Component: Install/UninstallAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 8.0CC: benl, nkinder, yzhang
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 8.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-29 23:10:42 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: 249650, 493682    
Attachments:
Description Flags
trivial fix proposal
none
diffs
none
cvs commit log none

Description Ulf Weltman 2009-02-19 22:16:19 UTC
According to a comment in the script, parameters in .inf files can be overridden on the command-line so:
setup-ds.pl -s -f /tmp/setup.inf slapd.ServerPort=1389

However, if setup.inf already contains ServerPort under [slapd], then init() in Setup.pm will create an array containing the old and the new value.  This doesn't seem right, start up will fail because the value of nsslapd-port in dse.ldif will be literally "ARRAY(0x800000010003c858)".

Should setup really be turning the scalar into an array, saving the old value?  I think the purpose of passing in an argument would be to either set if missing, or override if existing - not append.  Or am I forgetting some setup parameter where we would want to append?

Comment 1 Ulf Weltman 2009-02-19 22:19:49 UTC
Created attachment 332643 [details]
trivial fix proposal

Comment 2 Rich Megginson 2009-02-24 16:26:52 UTC
Created attachment 333059 [details]
diffs

Comment 3 Rich Megginson 2009-02-24 16:58:19 UTC
Created attachment 333061 [details]
cvs commit log

Reviewed by: ulf.weltman, nkinder (Thanks!)
Fix Description: Parameters specified on the command line should override and replace (not add to) any parameters specified in a given .inf file.  I refactored the code a little too - I moved the argv processing into the Inf module out of the Setup and Migration modules.  The code will first process the args and store the values in a temporary hash ref.  Then it will process the temp hash ref, replacing the values in the main inf with the values from the hash.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no

Comment 4 Yi Zhang 2009-04-07 23:16:52 UTC
Test is below, test result pass


< DS81rpm >[root@mv32a-vm ~]# setup-ds.pl -s -f ./mv32a.ds.ini slapd.ServerPort=1389
Your new DS instance 'mv32a-tmp' was successfully created.
Exiting . . .
Log file is '/tmp/setupoXO78H.log'

< DS81rpm >[root@mv32a-vm ~]# ps -elf | grep slapd
1 S nobody    2777     1  0  75   0 - 111180 stext 16:00 ?        00:00:00 ./ns-slapd -D /tmp/slapd-mv22a -i /tmp/slapd-mv22a/logs/slapd-mv32a-tmp.pid -w /tmp/slapd-mv22a/logs/slapd-mv32a-tmp.startpid

< DS81rpm >[root@mv32a-vm ~]# lsof -i TCP:2389
< DS81rpm >[root@mv32a-vm ~]# lsof -i TCP:1389
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
ns-slapd 2777 nobody    6u  IPv6   9778       TCP *:iclpv-dm (LISTEN)
< DS81rpm >[root@mv32a-vm ~]# cat mv32a.ds.ini | grep -i serverport
ServerPort=              2389

Comment 5 Chandrasekar Kannan 2009-04-29 23:10:42 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/RHEA-2009-0455.html