Bug 527912
Summary: | setup-ds.pl hangs at hostname prompt | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Frederic Hornain <fhornain> | ||||
Component: | Install/Uninstall | Assignee: | Nathan Kinder <nkinder> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 1.3.0 | CC: | amsharma, jgalipea, nhosoi, nkinder, rmeggins | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-12-07 17:12:14 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: | 639035, 656390 | ||||||
Attachments: |
|
Description
Frederic Hornain
2009-10-08 08:15:11 UTC
Ok, I think we can close this ticket. It seems that my VM was particularly slow and the stanza "Enter the fully qualified domain name of the computer" finished to appear correctly. Maybe due to what i did before ??? Indeed I've installed all 386-ds packages with admin stuffs and so on... and renew the command setup-ds.pl and it works correctly. Then I remove all 386-ds packages with admin stuffs except 389-ds-base. and renew again the setup-ds.pl command and it also works..... No idea of what cause the problem. Maybe my impatience to see something happening on the sceen... Sorry to have disturbed you. Thx for your help BR FRed Ok, I reopen the case cause after retarting the VM I still have the same strange behaviour. The setup-ds.pl hangs.... it seems it link to my static ip. Strange cause when I am setting dhcp ip it works well and when I am setting it in static ip it hangs forever.... Indeed it work but it takes more time to resolve this part of the program... Whatever the reason, I don't think setup should hang. We should do a better job of hostname/domainname detection. We currently use the perl module Net::Domain - the function hostfqdn(). This tries many different ways to figure out what the hostname and domainname are. I'm not sure why that would hang. If you have the time or the inclination, you could run setup in the perl debugger like this: perl -d /usr/sbin/setup-ds.pl b Net::Domain::hostfqdn to set a break point in Net::Domain::hostfqdn Can you provide steps to reproduce the problem? Dear Rich, I would not offend you or the 368 team in saying "the setup hangs". I wanted to say that the script took time to pass this step. My deep apologies if I offend you or your team. As I tried the directory facility tool in the previous version I thought it was a bug but now I do not think so. I will send you more details about what I did tomorrow. Sorry again. ;) Have a nice day, afternoon or evening. BR Frederic No offense taken. I believe this is a bug - setup should not hang trying to figure out what the hostname is. Even if setup has to make a DNS request, and there is some network problem which causes it to take a long time, we need to account for that. We need to let the user know what is happening, and set a smaller network timeout if possible. I believe that this is due to DNS timeouts. I have read that Net::Domain::hostfqdn can make multiple DNS queries, each of which will need to hit a DNS timeout. It will eventually return. I see a few things that we can do: - Add a message that the setup script can output stating that it is trying to determine the hostname and that it could take some time. - Switch to using something like Sys::Hostname, which doesn't use DNS (essentially the same as hostname -fqdn). Does anyone else have a strong opinion on which of these options we should go with? (In reply to comment #10) > I believe that this is due to DNS timeouts. I have read that > Net::Domain::hostfqdn can make multiple DNS queries, each of which will need to > hit a DNS timeout. It will eventually return. > > I see a few things that we can do: > > - Add a message that the setup script can output stating that it is trying to > determine the hostname and that it could take some time. We should probably do this, and add a message like "If you would rather not wait, Ctrl-C, run $0 again, and specify on the command line: $0 General.FullMachineName=your.hostname.domain.name ...otherargs..." > > - Switch to using something like Sys::Hostname, which doesn't use DNS > (essentially the same as hostname -fqdn). If it works better, I'm all for it. How does hostname -fqdn work without DNS? > > Does anyone else have a strong opinion on which of these options we should go > with? (In reply to comment #11) > If it works better, I'm all for it. How does hostname -fqdn work without DNS? According to the CPAN docs, Sys::Hostname uses the following logic: "It tries the first available of the C library's gethostname(), `$Config{aphostname}`, uname(2), syscall(SYS_gethostname), `hostname`, `uname -n`, and the file /com/host. If all that fails it croaks." I'm leaning towards the approach of just adding a message to the setup program. This has an advantage of detecting a DNS issue and raising the issue to the Administrator. It also won't alter our current hostname detection behavior. I should add that this issue is easily reproducible. To reproduce, simply comment out all valid DNS servers in /etc/resolv.conf and add a "nameserver" entry to an invalid private IP address. This will cause setup to take a long time when trying to contact the bogus DNS server. How long does it hang? Is there any way to timeout? (In reply to comment #14) > How long does it hang? > Is there any way to timeout? It appears to hang for 2 minutes when I configure a single bad nameserver in resolv.conf. I I configure 2 bad nameservers, it takes 4 minutes. I am not sure if there is any way to configure this timeout from within our setup program. Created attachment 474563 [details]
Patch
With this patch, the setup program output will look like this just prior to prompting for the hostname:
Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: eros.example.com.
To accept the default shown in brackets, press the Enter key.
Warning: This step may take a few minutes if your DNS servers
can not be reached or if DNS is not configured correctly. If
you would rather not wait, hit Ctrl-C and run this program again
with the following command line option to specify the hostname:
General.FullMachineName=your.hostname.domain.name
Pushed to master. Thanks to Noriko for her review! Counting objects: 13, done. Delta compression using up to 2 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (7/7), 1.01 KiB, done. Total 7 (delta 5), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git bd71726..53794a0 master -> master Hey , yes .. It halts at this point for about some seconds, but did not hang: Enter the fully qualified domain name of the computer on which you're setting up server software. Using the form <hostname>.<domainname> Example: eros.example.com. To accept the default shown in brackets, press the Enter key. Warning: This step may take a few minutes if your DNS servers can not be reached or if DNS is not configured correctly. If you would rather not wait, hit Ctrl-C and run this program again with the following command line option to specify the hostname: General.FullMachineName=your.hostname.domain.name ********************************************************************************* Directory Manager DN [cn=Directory Manager]: Password: Password (confirm): Your new DS instance 'amsharma1' was successfully created. Exiting . . . Log file is '/tmp/setup_oU0RL.log' Hence VERIFIED. |