Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
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.

dnsmasq not starting at boot

FreekFreek Member
edited June 2012 in Help

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?

  • FreekFreek Member
    edited June 2012

    That might've been handy to list indeed. Sorry about that!
    Ubuntu 10.04.4 - 64 Bit on Xen.

  • nabonabo Member

    @Freek said: How can I check why it doesn't start on boot?

    Have you checked the logfiles for an indication?

  • NickMNickM Member

    Try adding it to the startup sequence properly first...

    update-rc.d dnsmasq defaults

  • Or if using dependency boot...

    insserv -d dnsmasq

  • FreekFreek Member

    @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.

  • nabonabo Member

    @Freek said: @nabo /var/log/boot is empty and /var/log/messages doesn't contain anything about dnsmasq.

    dnsmasq logs to /var/log/daemon. See your /etc/syslog.conf for details.

  • FreekFreek Member

    @nabo /var/log/daemon is empty, as well as /etc/syslog.conf :O ?

  • update-rc.d dnsmasq defaults?

  • nabonabo Member

    @Freek said: /etc/syslog.conf

    Ubuntu changed it to /etc/rsyslog.d/50-default.conf. I though there still was more compatibility between Debian and Ubuntu. Apparently, not.

  • FreekFreek Member

    @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:

    #!/bin/sh
    [ "$IFACE" != "lo" ] || exit 0
    /usr/sbin/invoke-rc.d dnsmasq restart
    

    and make it executable
    chmod a+x /etc/network/if-up.d/dnsmasq

    Thanked by 1TheHackBox
  • FreekFreek Member
    edited June 2012

    @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.

  • FreekFreek Member

    @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.

  • FreekFreek Member
    edited September 2012

    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.

  • sleddogsleddog Member
    edited September 2012

    What does the init info at the top of the init script (/etc/init.d/dnsmasq) look like. Here's mine on Deb 6:

    ### 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

    And what does this show you...

    cat /etc/init.d/.depend.start

  • FreekFreek Member
    edited September 2012

    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.

  • sleddogsleddog Member
    edited September 2012

    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.

    Thanked by 2Freek EDinATL
  • 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).

  • FreekFreek Member
    edited September 2012

    @sleddog said: Remove any reference to 'bind-interfaces' in the config.

    That did the trick!! Wohooo!! Thanks man!

    @Raymii said: 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).

    Sadly did not work. dnsmasq doesn't seem to have a separate daemon. Luckily @sleddog suggestion fixed it! Finally! :D

    Thanked by 1EDinATL
Sign In or Register to comment.