Bug 486474 - overriding arguments to setup causes setup to fail
overriding arguments to setup causes setup to fail
Product: Red Hat Directory Server
Classification: Red Hat
Component: Install/Uninstall (Show other bugs)
All All
low Severity medium
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
Depends On:
Blocks: 249650 FDS1.2.0
  Show dependency treegraph
Reported: 2009-02-19 17:16 EST by Ulf Weltman
Modified: 2015-01-04 18:36 EST (History)
3 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-29 19:10:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
trivial fix proposal (1.60 KB, patch)
2009-02-19 17:19 EST, Ulf Weltman
no flags Details | Diff
diffs (5.96 KB, patch)
2009-02-24 11:26 EST, Rich Megginson
no flags Details | Diff
cvs commit log (551 bytes, text/plain)
2009-02-24 11:58 EST, Rich Megginson
no flags Details

  None (edit)
Description Ulf Weltman 2009-02-19 17:16:19 EST
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 17:19:49 EST
Created attachment 332643 [details]
trivial fix proposal
Comment 2 Rich Megginson 2009-02-24 11:26:52 EST
Created attachment 333059 [details]
Comment 3 Rich Megginson 2009-02-24 11:58:19 EST
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 19:16:52 EDT
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
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 19:10:42 EDT
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.


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