From owner-freebsd-questions@FreeBSD.ORG Wed Jan 6 18:11:23 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B1DB1065670 for ; Wed, 6 Jan 2010 18:11:23 +0000 (UTC) (envelope-from lists@midsummerdream.org) Received: from smtpauth04.prod.mesa1.secureserver.net (smtpauth04.prod.mesa1.secureserver.net [64.202.165.95]) by mx1.freebsd.org (Postfix) with SMTP id DB97D8FC19 for ; Wed, 6 Jan 2010 18:11:22 +0000 (UTC) Received: (qmail 20481 invoked from network); 6 Jan 2010 18:11:22 -0000 Received: from unknown (70.131.55.97) by smtpauth04.prod.mesa1.secureserver.net (64.202.165.95) with ESMTP; 06 Jan 2010 18:11:19 -0000 Message-ID: <4B44D245.6010106@midsummerdream.org> Date: Wed, 06 Jan 2010 12:11:17 -0600 From: Rob User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4B44B376.2010005@midsummerdream.org> <4B44B776.9050300@infracaninophile.co.uk> In-Reply-To: <4B44B776.9050300@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: mysql not starting on boot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lists@midsummerdream.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 18:11:23 -0000 To the mysql init script, I added: # REQUIRE: dhclient And to the dhclient init script I added: # REQUIRE: NETWORKING In addition to changing DHCP to SYNCDHCP in rc.conf, mysql now starts up on boot. I would think the dhclient change should be required in the default setup since NETWORKING should be up before attempting to grab a dhcp IP, or am I misunderstanding here? Either way, the above seems to have solved my problem. Thanks! Rob Matthew Seaman wrote: > Rob wrote: >> Since I upgraded to FreBSD 8.0, I'm noticing that mysql isn't starting >> on boot anymore. It starts fine once the system has booted, and >> looking at the mysql log I see: >> >> 100105 17:46:56 mysqld_safe Starting mysqld daemon with databases from >> /var/db/m >> ysql >> 100105 17:46:56 [ERROR] Can't start server: cannot resolve hostname!: >> Unknown er >> ror: 0 >> 100105 17:46:56 [ERROR] Aborting >> >> I use dhcp and ddns in my network, so I'm guessing that mysql is >> attempting to start before the networking has stabilized. Is there a >> way to make mysql be the last thing started at boot? > > MySQL will be happy if it can work out what the hostname of the machine > is. You say you're using ddns? If that means your machines are pushing > a hostname up to the DHCP server while they ask it for an IP number, then > there should be no problem. > > You can simply set the hostname in /etc/rc.conf -- it doesn't really > matter if the machine thinks its name is one thing, and the IPs on its > network interfaces resolve to something else (at least, not for the > purposes of running mysql.). The thing you'ld have to look out for are > the host part of usernames in grants of permissions to users. >> I tried adding: >> >> # REQUIRE: NETWORKING >> >> To the init script, but that didn't seem to have any effect. Is there >> a tool that will run through all the init scripts and tell you the >> order of startup? > > rcorder(8) > > You might also find it beneficial to use 'SYNCDHCP' instead of plain 'DHCP' > in ifconfig_XXY lines in /etc/rc.conf -- this will cause the boot > process to > block on getting an IP for the interface, rather than the default action of > backgrounding that process and trying to start everything else up. > > Cheers, > > Matthew >