DNSMasq won't start

--=== Your debug token is : vi6m3hus8o

Hi, I just installed pihole using the bash basic-install.sh method. I'm running a centos 7 minimal install as the OS.

sudo pihole status
::: DNS service is NOT running

sudo systemctl status dnsmasq
● dnsmasq.service - DNS caching server.
   Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2017-08-09 00:24:04 PDT; 4min 41s ago
  Process: 7814 ExecStart=/usr/sbin/dnsmasq -k (code=exited, status=3)
 Main PID: 7814 (code=exited, status=3)

Aug 09 00:24:04 dt-pihole.tang.local systemd[1]: Started DNS caching server..
Aug 09 00:24:04 dt-pihole.tang.local systemd[1]: Starting DNS caching server....
Aug 09 00:24:04 dt-pihole.tang.local dnsmasq[7814]: dnsmasq: cannot open log /var/log/pihole.log: Permission denied
Aug 09 00:24:04 dt-pihole.tang.local systemd[1]: dnsmasq.service: main process exited, code=exited, status=3/NOTIMPLEMENTED
Aug 09 00:24:04 dt-pihole.tang.local systemd[1]: Unit dnsmasq.service entered failed state.
Aug 09 00:24:04 dt-pihole.tang.local systemd[1]: dnsmasq.service failed.

seems like dnsmasq isn't running at all. Thanks in advance for the help!

Dnsmasq needs to be able to have r/w access to its log file:

dnsmasq: cannot open log /var/log/pihole.log: Permission denied

Here's the permissions on the log file:

ls -l /var/log/pi*
-rw-r--r--. 1 root   pihole 5875 Aug  9 00:13 /var/log/pihole_debug.log
-rw-r--r--. 1 pihole pihole 1860 Aug  9 21:26 /var/log/pihole-FTL.log
-rw-r--r--. 1 pihole pihole 2010 Aug  9 00:00 /var/log/pihole-FTL.log.1
-rw-r--r--. 1 root   root      0 Aug  8 23:55 /var/log/pihole.log

Who should I assign for owner & owner group?

thank you for looking at this!

It should be dnsmasq:root with those same permissions.

$ sudo chown dnsmasq:root pihole.log
[sudo] password for ~~~~~:
chown: invalid user: ‘dnsmasq:root’

I checked /etc/passwd and the dnsmasq user doesn't exist. dnsmasq is definitely installed but i'm not sure if i should manually create the user.

Hm, I think dnsmasq actually uses the user nobody on CentOS, so try replacing it with that.

Still no go. user is set correctly but it looks like an SELinux thing according to this: Dnsmasq: cannot open log /var/log/pihole.log: Permission denied

chcon -v --type=dnsmasq_var_log_t /var/log/pihole.log

that command, taken from the link, has allowed dnsmasq to start. Is this permanent? And should I leave it like that?

I'm not sure if that's permanent, and it's odd that dnsmasq can't open its own log without breaking SELinux.

Just restarted and it seems to have stuck. Dnsmasq started just fine but now i can't browse to http:///admin. Would you like me to make another post for that?

Thank you for your help.

It should be http://pi.hole/admin

sorry, i didn't notice the address i left. I've been trying http:/ip.address/admin and it just gives me a blank page.

also:

 lighttpd -t
2017-08-10 13:16:09: (server.c.824) No configuration available. Try using -f option.

not sure if that's relevant, never worked with lighttpd before.

Ok, open a new topic for that.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.