New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
dnsmasq not starting at boot
For some reason, dnsmasq isn't starting when I boot my VPS.
Every time I reboot my VPS, I have to manually type /etc/init.d/dnsmasq restart.
I already added '/etc/init.d/dnsmasq restart' to my /etc/rc.local file, but sadly doesn't make a difference.
How can I check why it doesn't start on boot?
Thanks
Comments
What OS?
That might've been handy to list indeed. Sorry about that!
Ubuntu 10.04.4 - 64 Bit on Xen.
Have you checked the logfiles for an indication?
Try adding it to the startup sequence properly first...
update-rc.d dnsmasq defaults
Or if using dependency boot...
insserv -d dnsmasq
@nabo /var/log/boot is empty and /var/log/messages doesn't contain anything about dnsmasq.
@NickM. It seems like it has already been added to the startup sequence:
System start/stop links for /etc/init.d/dnsmasq already exist.
@sleddog I'm not using dependency boot afaik.
dnsmasq logs to
/var/log/daemon
. See your/etc/syslog.conf
for details.@nabo /var/log/daemon is empty, as well as /etc/syslog.conf :O ?
update-rc.d dnsmasq defaults?
Ubuntu changed it to
/etc/rsyslog.d/50-default.conf
. I though there still was more compatibility between Debian and Ubuntu. Apparently, not.@TheHackBox @NickM already suggested that
@nabo Nothing to see there regarding dnsmasq...?
@Freek you can try start it when network is setup
create the file /etc/network/if-up.d/dnsmasq
with something like this:
and make it executable
chmod a+x /etc/network/if-up.d/dnsmasq
@prometeus Thanks, but again, 'computer says no'. I don't get it.. totally flabbergasted over here. Nothing to see in log files, it just doesn't start on boot. I have to execute 'service dnsmasq restart' manually after each and every boot to get it running....
Put this in /etc/dnsmasq.conf:
log-facility=/var/log/dnsmasq.log
Then restart dnsmasq, confirm that the log file is created and has data.
Then see what's there when you reboot.
@sleddog Thanks for the help, appreciate it.
I restarted dnsmasq, the log file is created and has data:
Jun 12 03:19:58 dnsmasq[5696]: started, version 2.52 cachesize 150
Jun 12 03:19:58 dnsmasq[5696]: compile time options: IPv6 GNU-getopt DBus I18N $
Jun 12 03:19:58 dnsmasq[5696]: reading /etc/resolv.conf
Jun 12 03:19:58 dnsmasq[5696]: using nameserver 8.8.4.4#53
Jun 12 03:19:58 dnsmasq[5696]: using nameserver 8.8.8.8#53
Jun 12 03:19:58 dnsmasq[5696]: read /etc/hosts - 2 addresses
After rebooting my VPS, this was the only line that was added:
Jun 12 03:20:17 dnsmasq[5696]: exiting on receipt of SIGTERM
Which is invoked by the reboot command I guess... No signs of why it's not booting.
Recently had to reboot my VPS due to a datacenter migration. When it came back online, I was unable to use my VPN. Started to change all sort of settings, just to realize after an hour or so that I forgot that dnsmasq doesn't boot (for some reason) on startup.
So I'm giving this a bump because it's starting to annoy me now.
What does the init info at the top of the init script (/etc/init.d/dnsmasq) look like. Here's mine on Deb 6:
And what does this show you...
cat /etc/init.d/.depend.start
Thanks for the reply @sleddog!
My init info at the top of the init script looks exactly the same, but here's it anyway:
`#!/bin/sh
BEGIN INIT INFO
Provides: dnsmasq
Required-Start: $network $remote_fs $syslog
Required-Stop: $network $remote_fs $syslog
Default-Start: 2 3 4 5
Default-Stop: 1
Description: DHCP and DNS server
END INIT INFO
`
cat /etc/init.d/.depend.start gives me:
cat: /etc/init.d/.depend.start: No such file or directory
That can't be good, can it?
Thanks in advance!
EDIT: Markdown and I will never be friends.
OK, forget that... guess your really are not using dependency boot.
Have a read at https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/876458
Post your dnsmasq.conf
Remove any reference to 'bind-interfaces' in the config.
I'm running out of ideas. I think it's a Ubuntu thing (upstart???) but I don't know Ubuntu well enough to say more.
If you want a hacky solution which does not fix your problem but might work:
Edit /etc/rc.local, add the daemon itself (dnsmasq -options) (not the rc.d script).
That did the trick!! Wohooo!! Thanks man!
Edit /etc/rc.local, add the daemon itself (dnsmasq -options) (not the rc.d script).
Sadly did not work. dnsmasq doesn't seem to have a separate daemon. Luckily @sleddog suggestion fixed it! Finally!