dnsmasq won't start automatically. [SOLVED]


  • Sorry guys I am frazzled been up all night messing more with Linux.

    dnsmasq is in rc.d and after booting

    service --status-all
    

    shows dnsmasq present in the list but it has a minus sign (not started). Starting dnsmasq manually - all good no errors.

    My router runs DHCP and dnsmasq is (now) on the FOG server for UEFI and Legacy PXE boot. The awesome guide by @george1421 worked like a charm.

    https://forums.fogproject.org/topic/12796/installing-dnsmasq-on-your-fog-server

    I found this in syslog

    Apr 26 07:25:25 fogger systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
    Apr 26 07:25:25 fogger dnsmasq[2610]: started, version 2.84rc2 DNS disabled
    Apr 26 07:25:25 fogger dnsmasq[2610]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC loop-detect inotify dumpfile
    Apr 26 07:25:25 fogger dnsmasq-dhcp[2610]: DHCP, proxy on subnet 192.168.1.100
    Apr 26 07:25:25 fogger systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
    Apr 26 07:25:25 fogger systemd[1]: Reached target Host and Network Name Lookups.
    

    Then further down in syslog dnsmasq entries related to the ltsp.conf settings. There are no errors or anything.

    I can provide any logs or confs if needed to solve the problem. I am so close and was thinking I could just start the service using cron

    @reboot sudo service dnsmasq start
    

    That seems like cheating and there has to be a correct way to do it.

    Thanks


  • @george1421 said in dnsmasq won't start automatically. [SOLVED]:

    @fog_newb Well there are really two commands you need to use.

    1. Enable the service to start every reboot systemctl enable dnsmasq
    2. To start the service now systemctl start dnsmasq

    These are two distinct actions and one doesn’t depend on the other.

    @george1421

    Thanks. I have used both of those commands before trying to get it to autostart on boot. I haven’t used them since running sudo systemctl enable dnsmasq , which was the one that got dnsmasq starting on boot for me. Perhaps since I used those commands prior it is all good?

    I went through my bash history and saw I almost used sudo systemctl enable dnsmasq I had the syntax messed up though. I used sudo systemctl dnsmasq enable

    I am really starting to like Linux. I digress, I am mostly a casual so I doubt I will ever have it on my daily driver but I am thinking about trying it on a laptop. I don’t know though, sometimes, I just like to point and click. 🙂

  • Moderator

    @fog_newb Well there are really two commands you need to use.

    1. Enable the service to start every reboot systemctl enable dnsmasq
    2. To start the service now systemctl start dnsmasq

    These are two distinct actions and one doesn’t depend on the other.


  • @george1421

    Hello,

    Nice! that worked. I’d swear I had tried that before as I was scouring different dnsmasq guides most of the night trying to get it started automatically.

    Thanks again.

    That thing it did after running the command, I never saw that come up last night.

    alt text

  • Moderator

    @fog_newb For systemd based systems if you want the service to start every time you would key in sudo systemctl enable dnsmasq That will set dnsmasq to start up automatically after every reboot.


  • Ooops I got the formatting wrong. Here is a text output.

    dnstext.log

  • Senior Developer

    @Fog_Newb After a reboot of the system run systemctl status dnsmasq and post output here.

279
Online

8.2k
Users

15.1k
Topics

141.9k
Posts