View previous topic :: View next topic |
Author |
Message |
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Oct 09, 2014 8:34 pm Post subject: dhcpcd takes too long to provide DNS |
|
|
Both at my desktop and at a dedicated server I've a nagging issue with dhcpcd during boot phase.
The dhcpcd service needs too long to deliver a working DNS. Therefore the next services (apache, ntp-client, tor, mysql) either refuse to start or gives warnings.
At my desktop I circumvented it by putting this quick&dirty into /etc/init.d/apache: Code: | while [[ : ]]
do
host <my hostname> && break
sleep 1
done
| into the start section.
But I dislike to put similar things into the init script at my server which currently immediately follows after dhcpdc, b/c that might change.
Isn't there any better solution ? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Oct 09, 2014 8:53 pm Post subject: |
|
|
Thx, I'll try that.
Well, whilst my desktop might be slow, the server gives me this in rc.log : Code: | rc default logging started at Thu Oct 9 22:12:18 2014
...
* Starting DHCP Client Daemon ...
[ ok ]
* Bringing up interface enp3s0
* config_enp3s0 not specified; defaulting to DHCP
* dhcp ...
* Running dhcpcd ...
dhcpcd[1752]: sending commands to master dhcpcd process
[ ok ]
* received address
[ ok ]
* Setting clock via the NTP client 'ntpdate' ...
Exiting, name server cannot be used: Temporary failure in name resolution (-3) * Failed to set clock
[ !! ]
* ERROR: ntp-client failed to start
* Starting ntpd ...
[ ok ]
...
rc default logging stopped at Thu Oct 9 22:12:22 2014
| == 4 seconds for this phase, I'm pretty sure it is too fast for dhcpcd to configure the resolv.conf, or ? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Oct 09, 2014 9:07 pm Post subject: |
|
|
Ick, I'm using Gentoo for a looong time, sometimes I do miss a bigger change...
I it no longer needed to add net.wlp3so or net.enp3s0 via "rc-update add ..." to a run level ? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Oct 09, 2014 10:21 pm Post subject: |
|
|
puh, I forgot to configure dnsmasq...
Now I do get about 1000 lines like Code: | Oct 10 00:15:17 n22 dnsmasq[2400]: DBus error: Connection ":1.0" is not allowed to own the service "uk.org.thekelleys.dnsmasq" due to security policies in the configuration file
| in my syslog before I could stop dnsmasq and configure it.
Mayby dnsmasq in level boot needs policy kit too ?
Last edited by toralf on Fri Oct 10, 2014 8:45 am; edited 1 time in total |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Fri Oct 10, 2014 8:43 am Post subject: |
|
|
Hhm, neither dhcpcd in level boot nor using the net.* scripts solved my issue, but this did it : Code: | # cat /etc/conf.d/net
postup()
{
if [[ "$IFACE" != "lo" ]]; then
host $HOSTNAME
fi
}
| Both my desktop, my KVM machines and my dedicated server works now fine with this. OTOH my UML instances works fine with dhcpcd in level boot and no net.* script in any other level.
Update rc_depend_strict="YES" seems to work too |
|
Back to top |
|
|
P.Kosunen Guru
Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Mon Mar 16, 2015 6:07 pm Post subject: |
|
|
I have same problem and nfs-mounts are also failing. rc_depend_strict="YES" and -b flag for dhcpcd didn't help. Tried with both static and dynamic ip.
I don't have dnsmasq installed in this machine, do i really need it? Name resolution is working after i login and ntp-client and netmount init scripts are also working when run manually.
Edit: Next boot after writing above and it seems to work. Cleared some log files before boot, but that shouldn't make difference. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Mon Mar 16, 2015 7:11 pm Post subject: |
|
|
It helped to put this into /etc/dhcpcd.conf:and to add the network itnerface explicitely instead of letting dhcpcd doing it during boot himself. |
|
Back to top |
|
|
|