Pi-Hole on Beaglebone Black

I used the normal curl command to install to the BBB. Upon trying to run, I always get this:

::: Blocking has been enabled! Job for dnsmasq.service failed because the control process exited with error code. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.

Reviewing the systemctl status dnsmasq.service shows this:

● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled) Drop-In: /run/systemd/generator/dnsmasq.service.d └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf Active: failed (Result: exit-code) since Mon 2017-05-15 19:22:31 UTC; 1min 19s ago Process: 3367 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=1/FAILURE) Main PID: 1024 (code=exited, status=0/SUCCESS)

May 15 19:22:31 beaglebone systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server... May 15 19:22:31 beaglebone dnsmasq[3367]: dnsmasq: illegal repeated keyword at line 8 of /etc/dnsmasq.d/SoftAp0 May 15 19:22:31 beaglebone systemd[1]: dnsmasq.service: Control process exited, code=exited status=1 May 15 19:22:31 beaglebone systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server. May 15 19:22:31 beaglebone systemd[1]: dnsmasq.service: Unit entered failed state. May 15 19:22:31 beaglebone systemd[1]: dnsmasq.service: Failed with result 'exit-code'.

I understand the cache statement is the problem, but when I comment it out in SoftAp0 it works until reboot at which point it uncomments it. Also, FTL doesn't seem to want to work either.

Here is the output of pihole -d

root@beaglebone:/home/ken# pihole -d
::: Beginning Pi-hole debug at Mon May 15 21:19:25 UTC 2017!
:::
::: This process collects information from your Pi-hole, and optionally uploads
::: it to a unique and random directory on tricorder.pi-hole.net.
:::
::: NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers
::: can access your data via the given token. We have taken these extra steps to
::: secure your data and will work to further reduce any personal information gathered.
:::
::: Please read and note any issues, and follow any directions advised during this process.
:::
::: ---= Detecting Installed Package Versions:
::: Pi-hole: v3.0.1 (master:v3.0.1-0-g26fcb1b)
::: Pi-hole Dashboard: v3.0.1 (master:v3.0.1-0-ge204cea)
::: lighttpd/1.4.35
::: PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 10:31:58)
:::
::: ---= Detecting existence of /etc/pihole/setupVars.conf:
::: File exists, parsing...done and was successfully sourced
:::
::: ---= Detecting installed OS Distribution
:::
::: ---= Checking processor variety
:::
::: ---= Checking IPv6 Stack
::: IPv6 addresses located on eth0
::: No gateway detected.
:::
::: ---= Checking IPv4 Stack
::: IPv4 addresses located on eth0
::: Pinging default IPv4 gateway: Gateway responded.
::: Pinging Internet via IPv4: Query responded.
:::
::: ---= Daemon Process Information
::: Checking http port for lighttpd listener.
::: Correctly configured.
:::
::: ---= Daemon Process Information
::: Checking domain port for dnsmasq listener.
::: Failure: IPv4 Port not in use
:::
::: ---= Daemon Process Information
::: Checking 4711 port for pihole-FTL listener.
::: Failure: IPv4 Port not in use
:::
::: ---= Processes Check
::: Logging status of lighttpd, dnsmasq and pihole-FTL...
:::
::: ---= Resolver Functions Check (IPv4)
::: Checking for necessary lighttpd files.
:::
::: ---= Detecting existence of /etc/lighttpd/lighttpd.conf:
::: File exists, parsing...done
:::
::: ---= Detecting existence of /var/log/lighttpd/error.log:
::: File exists, parsing...done
:::
:::
::: ---= Detecting existence of /etc/dnsmasq.conf:
::: File exists, parsing...done
:::
::: ---= Detecting contents of /etc/dnsmasq.d/*:
:::
::: ---= File /etc/dnsmasq.d/01-pihole.conf found
::: Parsing...done
:::
::: ---= File /etc/dnsmasq.d/README found
::: Parsing...done
:::
::: ---= File /etc/dnsmasq.d/SoftAp0 found
::: Parsing...done
:::
:::
::: ---= Detecting existence of /etc/pihole/whitelist.txt:
::: File exists, parsing...done
:::
::: ---= Detecting existence of /etc/pihole/blacklist.txt:
::: /etc/pihole/blacklist.txt not found!
:::
::: ---= Detecting existence of /etc/pihole/adlists.list:
::: File exists, parsing...done
:::
::: ---= Analyzing gravity.list
:::
::: ---= Analyzing pihole.log
:::
::: ---= Analyzing pihole-FTL.log
:::
::: --= User Action Required =--
::: Try loading a site that you are having trouble with now from a client web browser..
::: (Press CTRL+C to finish logging.)
:::
::: ---= pihole.log
::: Logging will automatically teminate in 60 seconds
::: Finshed debugging!.

Any help would be greatly appreciated.

What is the SoftAp0 file from? That's not a Pi-hole file. Also, the debug log should have given you a debug token, but it appears to have stopped prematurely.

Try move that file to somewhere else like your home folder:

sudo mv /etc/dnsmasq.d/SoftAp0 ~

And restart dnsmasq:

sudo systemctl restart dnsmasq.service

And check status again:

sudo systemctl status dnsmasq.service

To undo:

sudo mv ~/SoftAp0 /etc/dnsmasq.d/
sudo systemctl restart dnsmasq.service

The service name "dnsmasq.service" is different from the default used by Pi-Hole namely "dnsmasq".
This might cause issues too but dont know the Pi-Hole code well enough if it can deal with this alternate name.

Missed this bit.
You could try figure out where that file "SoftAp0" comes from:

dpkg -S SoftAp0

sudo grep SoftAp0 -R /etc/

What is displayed when you run below 3:

sudo /usr/bin/pihole-FTL

strings /usr/bin/pihole-FTL | head -1

readlink /lib/ld-linux.so.3

dnsmasq.service is just a more explicit way to reference the same service.

Got that.

@KPryor ,
to try prevent that file being created at boot, you could move the file, as described earlier, and create an empty placeholder file thats only writable by root:

sudo mv /etc/dnsmasq.d/SoftAp0 ~
sudo touch /etc/dnsmasq.d/SoftAp0
sudo chmod 400 /etc/dnsmasq.d/SoftAp0

Thanks for the the feedback! Sorry it took me so long to respond. I deleted the SoftAp0 file and then created a new one with touch. chmod wouldn't protect it from being recreated, but I was able to protect it with chattr +i. Pi-hole is now working, but the web interface does not display stats. I am attaching a screenshot of the web dashboard. Also, the /var/log/lighttpd/error.log was tremendous in size. Here is my pihole -d output:

---= Detecting Installed Package Versions:

Pi-hole: v3.0.1 (master:v3.0.1-0-g26fcb1b)
Pi-hole Dashboard: v3.0.1 (master:v3.0.1-0-ge204cea)
lighttpd/1.4.35
PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 10:31:58)

---= Detecting existence of /etc/pihole/setupVars.conf:

PIHOLE_INTERFACE=eth0
IPV4_ADDRESS=192.168.2.103/24
IPV6_ADDRESS=
QUERY_LOGGING=true
INSTALL_WEB=true
DNSMASQ_LISTENING=single
PIHOLE_DNS_1=208.67.222.222
PIHOLE_DNS_2=208.67.220.220
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSSEC=true

---= Detecting installed OS Distribution

PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="Debian -- User Support"
BUG_REPORT_URL="https://bugs.debian.org/"

---= Checking processor variety

armv7l

---= Checking IPv6 Stack

IPv6 on eth0
Gravity configured for: NOT CONFIGURED

fe80::1eba:8cff:fed9:4ee4/64
No gateway detected.

---= Checking IPv4 Stack

IPv4 on eth0
Gravity configured for: 192.168.2.103/24

192.168.2.103/24
--- 192.168.2.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.554/0.572/0.606/0.024 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 70.223/72.926/76.982/2.936 ms

---= Daemon Process Information

Found user www-data with process lighttpd

---= Daemon Process Information

Found user dnsmasq with process dnsmasq

---= Daemon Process Information

Failure: IPv4 Port not in use

---= Processes Check

Status for lighttpd daemon:
active
Status for dnsmasq daemon:
active
Status for pihole-FTL daemon:
active

---= Resolver Functions Check (IPv4)

Resolution of santanderjuridica.entrydns.org from Pi-hole (127.0.0.1):
192.168.2.103

Resolution of santanderjuridica.entrydns.org from Pi-hole (192.168.2.103):
192.168.2.103

Resolution of santanderjuridica.entrydns.org from 8.8.8.8:
NXDOMAIN

Pi-hole dnsmasq specific records lookups
Cache Size:
"1500"
Upstream Servers:
"8.8.8.8#53 7911 237"

---= Detecting existence of /etc/lighttpd/lighttpd.conf:

server.modules = (
"mod_access",
"mod_accesslog",
"mod_auth",
"mod_expire",
"mod_compress",
"mod_redirect",
"mod_setenv",
"mod_rewrite"
)
server.document-root = "/var/www/html"
server.error-handler-404 = "pihole/index.php"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
accesslog.filename = "/var/log/lighttpd/access.log"
accesslog.format = "%{%s}t|%V|%r|%s|%b"
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
$HTTP["url"] =~ "^/admin/" {
setenv.add-response-header = (
"X-Pi-hole" => "The Pi-hole Web interface is working!",
"X-Frame-Options" => "DENY"
)
}
url.rewrite = ( "^(?!/admin/)..js$" => "pihole/index.js" )
$HTTP["url"] =~ "^(?!/admin)/.
" {
setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
}
$HTTP["host"] == "pi.hole" {
$HTTP["url"] == "/" {
url.redirect = ( "" => "/admin/" )
}
}
include_shell "cat external.conf 2>/dev/null"

---= Detecting existence of /var/log/lighttpd/error.log:

/var/log/lighttpd/error.log not found!

---= Detecting existence of /etc/dnsmasq.conf:

conf-dir=/etc/dnsmasq.d

---= Detecting contents of /etc/dnsmasq.d/*:

---= File /etc/dnsmasq.d/01-pihole.conf found

addn-hosts=/etc/pihole/gravity.list
addn-hosts=/etc/pihole/local.list
localise-queries
no-resolv
cache-size=10000
log-queries
log-facility=/var/log/pihole.log
local-ttl=300
log-async
server=208.67.222.222
server=208.67.220.220
domain-needed
bogus-priv
dnssec
trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
interface=eth0

---= File /etc/dnsmasq.d/README found

---= File /etc/dnsmasq.d/SoftAp0 found

---= Detecting existence of /etc/pihole/whitelist.txt:

raw.githubusercontent.com
mirror1.malwaredomains.com
sysctl.org
zeustracker.abuse.ch
s3.amazonaws.com
hosts-file.net

---= Detecting existence of /etc/pihole/blacklist.txt:

/etc/pihole/blacklist.txt not found!

---= Detecting existence of /etc/pihole/adlists.list:

https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt

---= Analyzing gravity.list

/etc/pihole/gravity.list is 106255 lines long.

---= Analyzing pihole.log

/var/log/pihole.log is 415 lines long.
/var/log/pihole.log is 32K.

---= Analyzing pihole-FTL.log

/var/log/pihole-FTL.log is 145 lines long.
/var/log/pihole-FTL.log is 12K.
[2017-05-15 19:41:25.767] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:41:28.778] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:41:29.781] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:41:36.607] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:41:41.624] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:41:41.836] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:24.575] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:40.226] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:40.627] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:43.636] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:44.038] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:47.245] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:50.054] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:50.255] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:55.271] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:56.677] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:42:58.082] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:13.530] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:27.975] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:30.786] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:30.987] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:39.415] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:43:43.028] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:44:48.661] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:44:58.896] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:45:09.132] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:45:19.366] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:46:18.559] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:46:18.760] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:46:18.961] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:46:24.381] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:46:24.582] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:47:20.782] Warning: Reading of log file /var/log/pihole.log failed
[2017-05-15 19:48:28.737] FATAL: FTL received SIGTERM from PID/UID 8264/0, scheduled to exit gracefully
[2017-05-15 19:48:28.738] Shutting down...
[2017-05-15 19:48:28.740] ########## FTL terminated! ##########
[2017-05-15 19:49:22.910] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-15 19:49:22.921] Make sure it exists and is readable by user pihole
[2017-05-15 21:12:14.561] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-15 21:12:14.564] Make sure it exists and is readable by user pihole
[2017-05-16 00:12:16.648] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-16 00:12:16.659] Make sure it exists and is readable by user pihole
[2017-05-16 00:14:50.084] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-16 00:14:50.103] Make sure it exists and is readable by user pihole
[2017-05-16 00:21:30.632] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-16 00:21:30.637] Make sure it exists and is readable by user pihole
[2017-05-16 01:37:12.839] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-16 01:37:12.849] Make sure it exists and is readable by user pihole
[2017-05-16 01:40:24.147] FATAL: Opening of /var/log/pihole.log failed!
[2017-05-16 01:40:24.151] Make sure it exists and is readable by user pihole

---= pihole.log

Again, thank you for the help!

Ken

FTL seems to have crashed. The dnsmasq log file was unable to be opened by FTL:

[2017-05-15 19:42:55.271] Warning: Reading of log file /var/log/pihole.log failed

It's probably a permissions error, so you need to make sure the pihole user can access that file.

Ok, I gave the pihole user permission for the pihole.log. Here is my new pihole -d output:

root@beaglebone:/var/log# pihole -d
::: Beginning Pi-hole debug at Tue May 16 02:43:05 UTC 2017!
:::
::: This process collects information from your Pi-hole, and optionally uploads
::: it to a unique and random directory on tricorder.pi-hole.net.
:::
::: NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers
::: can access your data via the given token. We have taken these extra steps to
::: secure your data and will work to further reduce any personal information gathered.
:::
::: Please read and note any issues, and follow any directions advised during this process.
:::
::: ---= Detecting Installed Package Versions:
::: Pi-hole: v3.0.1 (master:v3.0.1-0-g26fcb1b)
::: Pi-hole Dashboard: v3.0.1 (master:v3.0.1-0-ge204cea)
::: lighttpd/1.4.35
::: PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 10:31:58)
:::
::: ---= Detecting existence of /etc/pihole/setupVars.conf:
::: File exists, parsing...done and was successfully sourced
:::
::: ---= Detecting installed OS Distribution
:::
::: ---= Checking processor variety
:::
::: ---= Checking IPv6 Stack
::: IPv6 addresses located on eth0
::: No gateway detected.
:::
::: ---= Checking IPv4 Stack
::: IPv4 addresses located on eth0
::: Pinging default IPv4 gateway: Gateway responded.
::: Pinging Internet via IPv4: Query responded.
:::
::: ---= Daemon Process Information
::: Checking http port for lighttpd listener.
::: Correctly configured.
:::
::: ---= Daemon Process Information
::: Checking domain port for dnsmasq listener.
::: Correctly configured.
:::
::: ---= Daemon Process Information
::: Checking 4711 port for pihole-FTL listener.
::: Failure: IPv4 Port not in use
:::
::: ---= Processes Check
::: Logging status of lighttpd, dnsmasq and pihole-FTL...
:::
::: ---= Resolver Functions Check (IPv4)
::: Checking for necessary lighttpd files.
:::
::: ---= Detecting existence of /etc/lighttpd/lighttpd.conf:
::: File exists, parsing...done
:::
::: ---= Detecting existence of /var/log/lighttpd/error.log:
::: /var/log/lighttpd/error.log not found!
:::
:::
::: ---= Detecting existence of /etc/dnsmasq.conf:
::: File exists, parsing...done
:::
::: ---= Detecting contents of /etc/dnsmasq.d/*:
:::
::: ---= File /etc/dnsmasq.d/01-pihole.conf found
::: Parsing...done
:::
::: ---= File /etc/dnsmasq.d/README found
::: Parsing...done
:::
::: ---= File /etc/dnsmasq.d/SoftAp0 found
::: Parsing...done
:::
:::
::: ---= Detecting existence of /etc/pihole/whitelist.txt:
::: File exists, parsing...done
:::
::: ---= Detecting existence of /etc/pihole/blacklist.txt:
::: /etc/pihole/blacklist.txt not found!
:::
::: ---= Detecting existence of /etc/pihole/adlists.list:
::: File exists, parsing...done
:::
::: ---= Analyzing gravity.list
:::
::: ---= Analyzing pihole.log
:::
::: ---= Analyzing pihole-FTL.log
:::
::: --= User Action Required =--
::: Try loading a site that you are having trouble with now from a client web browser..
::: (Press CTRL+C to finish logging.)
:::
::: ---= pihole.log
::: Logging will automatically teminate in 60 seconds
::: Finshed debugging!.
::: The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.
::: Would you like to upload the log? [y/N] y
::: ---=== Your debug token is : v0e4w9d2wz Please make a note of it. ===---
::: Contact the Pi-hole team with your token for assistance.
::: Thank you.
::: A local copy of the Debug log can be found at : /var/log/pihole_debug.log

What is your current status? I see you delete one post.

Yes, I posted and then deleted because I found another issue. The good news is, Pi-Hole is working on the BBB now. The bad news is, if I use the web interface to query logs, the lighttpd error log begins filling up until it fills the entire disk if I let it, at which point the device is pretty useless. The lighttpd error.log has this repeated over and over:

2017-05-16 16:19:52: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning: feof() expects parameter 1 to be resource, boolean given in /var/www/html/admin/scripts/pi-hole/php/tailLog.php on line 32
2017-05-16 16:19:52: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/html/admin/scripts/pi-hole/php/tailLog.php on line 33

Thanks!
Ken

I said the above incorrectly. That does not occur when I query logs, but rather when I select Tools/tail pi-hole.log or tail pi-hole-FTL.log.

That means that PHP failed to open /var/log/pihole.log resp. /var/log/pihole-FTL.log.

Ok, thank you. I'll take a look at the permissions again.

Did you resolve your issue ?

My apologies for failing to update this post sooner. As of now, the BBB is working perfectly, except for the issue of not being able to use the tail logs function in the web interface. I looked at permissions and so on, but did not figure out the issue. It's not a big problem for me, so I'm not overly concerned with it now. Everything else works very well. Thank you all!

The file SoftAp0 is generated by /opt/scripts/boot/am335x_evm.sh. This file is buggy. I made the bug report here: SoftAp0 causes wrong DNS resolution · Issue #55 · RobertCNelson/boot-scripts · GitHub

2 posts were split to a new topic: Pi-hole's default cache directive conflicts with cache-size directive in SoftAP0