Beaglebone - ads not being blocked (I searched the forums!)

After I rebooted, the web-admin page wouldn't load, and it looks like lighttpd was not started. I started it manually and I got the page back. However, the dashboard said "lost connection to API". Pihole status said DNS was not running. Also, ads were back.

New debug log:

[βœ“] Your debug token is: fs69iq793o

I didn't release/renew IPs for my client devices because I figured the above issues were fatal anyhow.

=]

Below ones might give some info:

sudo service pihole-FTL status -l

sudo service lighttpd status -l

debian@beaglebone:~$ sudo service pihole-FTL status -l
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-11-25 23:31:06 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1067 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/pihole-FTL.service

Nov 25 23:30:56 beaglebone systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 25 23:30:57 beaglebone pihole-FTL[1067]: Not running
Nov 25 23:30:58 beaglebone pihole-FTL[1067]: chown: cannot access '/etc/pihole/dhcp.lea
Nov 25 23:31:00 beaglebone pihole-FTL[1067]: /etc/resolvconf/update.d/libc: Warning: /e
Nov 25 23:31:02 beaglebone su[1308]: Successful su for pihole by root
Nov 25 23:31:05 beaglebone pihole-FTL[1067]: dnsmasq: cannot open or create lease file
Nov 25 23:31:06 beaglebone systemd[1]: Started LSB: pihole-FTL daemon.

ebian@beaglebone:~$ sudo service lighttpd status -l
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-11-25 23:31:41 UTC; 6min ago
  Process: 2393 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 2373 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 2393 (code=exited, status=255)

Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 25 23:31:41 beaglebone systemd[1]: Stopped Lighttpd Daemon.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 25 23:31:41 beaglebone systemd[1]: Failed to start Lighttpd Daemon.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Unit entered failed state.
Nov 25 23:31:41 beaglebone systemd[1]: lighttpd.service: Failed with result 'exit-code'.

What could be killing these?

Bits are cut off on that status line.
Can you post results for below one instead (after fresh reboot) ?

sudo systemctl status pihole-FTL -l

For lighttpd, can you post results for below ones ?

sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471'

sudo tail /var/log/lighttpd/error.log

debian@beaglebone:~$ sudo systemctl status pihole-FTL -l
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-11-25 23:31:06 UTC; 13min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1067 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/pihole-FTL.service

Nov 25 23:30:56 beaglebone systemd[1]: Starting LSB: pihole-FTL daemon...
Nov 25 23:30:57 beaglebone pihole-FTL[1067]: Not running
Nov 25 23:30:58 beaglebone pihole-FTL[1067]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
Nov 25 23:31:00 beaglebone pihole-FTL[1067]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
Nov 25 23:31:02 beaglebone su[1308]: Successful su for pihole by root
Nov 25 23:31:05 beaglebone pihole-FTL[1067]: dnsmasq: cannot open or create lease file /var/run/dnsmasq.leases: Permission denied
Nov 25 23:31:06 beaglebone systemd[1]: Started LSB: pihole-FTL daemon.

====

debian@beaglebone:~$ sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

====

debian@beaglebone:~$ sudo tail /var/log/lighttpd/error.log
2018-11-25 22:26:14: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 22:26:16: (log.c.217) server started
2018-11-25 22:26:16: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 22:26:41: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 23:18:32: (log.c.217) server started
2018-11-25 23:18:32: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 23:21:51: (server.c.1828) server stopped by UID = 0 PID = 1
2018-11-25 23:24:07: (log.c.217) server started
2018-11-25 23:24:07: (server.c.1295) WARNING: unknown config-key: alias.url (ignored)
2018-11-25 23:30:09: (server.c.1828) server stopped by UID = 0 PID = 1

====

Linux capabilities missing probably:

https://docs.pi-hole.net/ftldns/in-depth/#linux-capabilities

Try:

sudo sed -i 's/FTLUSER=pihole/FTLUSER=root/' /etc/init.d/pihole-FTL

And after reboot, check Pi-hole status again.

For lighttpd, can you try the netstat command again copying the line exactly as I posted before ?
Am missing bits.
Or if still no data displayed, try without grep:

sudo netstat -nltup

debian@beaglebone:~$ pihole status
[sudo] password for debian:
[βœ“] DNS service is running
[βœ“] Pi-hole blocking is Enabled

====

debian@beaglebone:~$ sudo netstat -nltup | grep 'Proto|:53 |:67 |:80 |:471'
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1432/pihole-FTL
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 1432/pihole-FTL
tcp6 0 0 :::80 :::* LISTEN 1/init
tcp6 0 0 :::53 :::* LISTEN 1432/pihole-FTL
tcp6 0 0 ::1:4711 :::* LISTEN 1432/pihole-FTL
udp 0 0 0.0.0.0:53 0.0.0.0:* 1432/pihole-FTL
udp 0 0 0.0.0.0:67 0.0.0.0:* 1432/pihole-FTL
udp6 0 0 :::53 :::* 1432/pihole-FTL

====

That is weird.
Looks like the init process is listening on IPv6 TCP port 80 preventing lighttpd to bind to this socket.
Never seen this before :smiley:

And below one ?

sudo ss -nlutp

debian@beaglebone:~$ sudo ss -nlutp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 :53 : users:(("pihole-FTL",pid=1432,fd=6))
udp UNCONN 0 0 :67 : users:(("pihole-FTL",pid=1432,fd=4))
udp UNCONN 0 0 :68 : users:(("dhcpcd",pid=1297,fd=10))
udp UNCONN 0 0 :58449 : users:(("avahi-daemon",pid=1026,fd=14))
udp UNCONN 0 0 :5353 : users:(("avahi-daemon",pid=1026,fd=12))
udp UNCONN 0 0 :::546 :::
users:(("dhcpcd",pid=1297,fd=14))
udp UNCONN 0 0 :::53 :::
users:(("pihole-FTL",pid=1432,fd=8))
udp UNCONN 0 0 :::34152 :::
users:(("avahi-daemon",pid=1026,fd=15))
udp UNCONN 0 0 :::5353 :::
users:(("avahi-daemon",pid=1026,fd=13))
tcp LISTEN 0 32 :53 : users:(("pihole-FTL",pid=1432,fd=7))
tcp LISTEN 0 128 :22 : users:(("sshd",pid=1264,fd=3))
tcp LISTEN 0 5 127.0.0.1:4711 : users:(("pihole-FTL",pid=1432,fd=12))
tcp LISTEN 0 128 :::8080 :::
users:(("apache2",pid=1345,fd=4),("apache2",pid=1344,fd=4),("apache2",pid=1336,fd=4))
tcp LISTEN 0 32 :::53 :::
users:(("pihole-FTL",pid=1432,fd=9))
tcp LISTEN 0 128 :::22 :::
users:(("sshd",pid=1264,fd=4))
tcp LISTEN 0 128 :::1880 :::* users:(("systemd",pid=1,fd=49))
tcp LISTEN 0 128 :::3000 :::* users:(("systemd",pid=1,fd=47))
tcp LISTEN 0 5 ::1:4711 :::* users:(("pihole-FTL",pid=1432,fd=13))

====

Now port 80 is gone.
I know netstat is depreciated but suspect something still wrong with your setup and dont know what :frowning:

Maybe this will help - This is a Beaglebone Black who's OS image contains some stuff that works on port 80, as described in this article:

I removed node.js by Googling how to do so but I suppose there could be remnants.

Is there a place I can find a listing of startup items?

Thank you for giving this issue so much of your time!

=]

Yeah this is likely.

The list is extensive:

sudo systemctl

Ps. you can disable lighttpd from listening to IPv6 if you dont use IPv6.
Put a hash in front of below line in the file "/etc/lighttpd/lighttpd.conf"

# include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port

Restart or maybe even reboot:

sudo service lighttpd restart

And check again:

sudo netstat -nltup | grep 'Proto\|:53 \|:67 \|:80 \|:471'

1 Like

UNIT LOAD ACTIVE SUB DESCRIPTION
● bonescript-autorun.service loaded failed failed Bonescript autorun
● bonescript.service loaded failed failed Bonescript server
● lightdm.service loaded failed failed Light Display Manager
● bonescript.socket loaded failed failed bonescript.socket

====

There's also connman, which I thought was not present on my system, but is referenced in that article I linked to specific to Beaglebone:

connman.service loaded active running Connection service

====

I read that I can use update-rc.d to remove some of these services from startup. Can you recommend this? If so, which services do you think I should remove?

=]

Syntax is:

sudo systemctl start|stop|enable|disable <UNIT_OR_SERVICE>

Most all Linux commands have man pages:

man systemctl

update-rc.d is the old depreciated way for systems using the systemV init system.
Yours is using the systemd init system:

pi@noads:~ $ ls -l /sbin/init
lrwxrwxrwx 1 root root 20 Jun 13 22:20 /sbin/init -> /lib/systemd/systemd
1 Like

Ahh, very interesting. I used systemctl as found here:

sudo systemctl disable bonescript.service
sudo systemctl disable bonescript-autorun.service
sudo systemctl disable bonescript.socket
sudo systemctl disable bonescript-autorun.service

I added (not sure if this has any real effect):

sudo systemctl disable cloud9.socket

and now Pi-Hole seems to start/work as expected!

Thanks again, I'mma donate now.

2 Likes

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