1

I'm very new to Linux, Ubuntu and this forum. I am using Ubuntu 20.04 in a VM as a wireless access point and I'm having a problem which is best explained with code:

john@HomeDT:~$ sudo service dnsmasq stop
[sudo] password for john: 
john@HomeDT:~$ sudo service dnsmasq start
Job for dnsmasq.service failed because the control process exited with error code.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
john@HomeDT:~$ sudo systemctl status -l dnsmasq
 dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2021-01-30 22:00:31 GMT; 9s ago
    Process: 7541 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
    Process: 7542 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=3)

Jan 30 22:00:30 HomeDT systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jan 30 22:00:30 HomeDT dnsmasq[7541]: dnsmasq: syntax check OK.
Jan 30 22:00:31 HomeDT dnsmasq[7542]: dnsmasq: cannot open log /tmp/dnsmasq.log: Permission denied
Jan 30 22:00:31 HomeDT dnsmasq[7542]: cannot open log /tmp/dnsmasq.log: Permission denied
Jan 30 22:00:31 HomeDT dnsmasq[7542]: FAILED to start up
Jan 30 22:00:31 HomeDT systemd[1]: dnsmasq.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Jan 30 22:00:31 HomeDT systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Jan 30 22:00:31 HomeDT systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
john@HomeDT:~$ sudo mv /tmp/dnsmasq.log /tmp.dnsmasq.log.old
john@HomeDT:~$ sudo service dnsmasq start
john@HomeDT:~$ sudo service dnsmasq status
 dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-01-30 22:01:02 GMT; 13s ago
    Process: 7776 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
    Process: 7777 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
    Process: 7788 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
   Main PID: 7787 (dnsmasq)
      Tasks: 1 (limit: 4653)
     Memory: 87.7M
     CGroup: /system.slice/dnsmasq.service
             └─7787 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new ->

Jan 30 22:01:00 HomeDT systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jan 30 22:01:00 HomeDT dnsmasq[7776]: dnsmasq: syntax check OK.
Jan 30 22:01:02 HomeDT systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

This file that dnsmasq can't access is created by the dnsmasq service and has these permissions:1

I've googled every search term that I can think of for this and I can't find anything that relates. I have tried running various commands that I have found on askubuntu that alter the permissions for the file (sorry, I can't remember what they are) and nothing that I do seems to help.

Does anyone know what I need to do to fix this please?

Thanks in advance

1
  • 1
    What is the output of ls -al / | grep tmp?
    – heynnema
    Jan 31, 2021 at 16:19

1 Answer 1

1

I know this answer comes late, but I found the solution. Just remove the log file and restart dnsmasq

rm /tmp/dnsmasq.log
systemctl restart dnsmasq

A new log file will be generated

EDIT: The fix above is only temporary; next time dnsmasq starts it will fail again. To fix this I uninstalled it with apt and compiled it from source instead

apt remove dnsmasq
cd ~/Downloads
git clone git://thekelleys.org.uk/dnsmasq.git
cd dnsmasq
make install (as root)
1
  • Thank you camelCase, I appreciate the answer. Unfortunately I ended up abandoning this about a month later, I opted for RaspAP on a Pi instead. Aug 19, 2021 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.