Please help: blocking works, but console shows "FTL offline"

Hello there,
since a couple of days I noticed admin console showing "Active" and "FTL offline".
I still have data on web interface and blocking still works.

Here the output of "systemctl status pihole-FTL"
Sep 12 21:43:17 NAS systemd[1]: Starting LSB: pihole-FTL daemon...
Sep 12 21:43:17 NAS pihole-FTL[28317]: Not running
Sep 12 21:43:17 NAS pihole-FTL[28317]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
Sep 12 21:43:17 NAS su[28355]: Successful su for pihole by root
Sep 12 21:43:17 NAS su[28355]: + ??? root:pihole
Sep 12 21:43:17 NAS su[28355]: pam_unix(su:session): session opened for user pihole by (uid=0)
Sep 12 21:43:17 NAS su[28355]: pam_systemd(su:session): Failed to create session: Start job for unit user@999.service failed with 'failed'
Sep 12 21:43:17 NAS pihole-FTL[28317]: FTL started!
Sep 12 21:43:17 NAS su[28355]: pam_unix(su:session): session closed for user pihole
Sep 12 21:43:17 NAS systemd[1]: Started LSB: pihole-FTL daemon.

I am still at the beginning of understanding linux. Could pleease someone help?

ty

try sudo touch /etc/pihole/dhcp.leases
sudo service pihole-FTL restart

Hello and thank you for your answer. I just did "sudo touch /etc/pihole/dhcp.leases" and "sudo service pihole-FTL restart", but "sudo service pihole-FTL status" still shows:

Sep 13 13:03:36 NAS su[7136]: pam_systemd(su:session): Failed to create session: Start job for unit user@999.service failed with 'failed'

What is "pam_systemd(su:session)"???

Thank you for your help!

Hi, as I wrote I still learn linux, but I get better fron day to day...
"systemctl status user@999.service" showed permission-problems with "system.d"...user/group was "urbackup" and not "root". So I corrected all files owned by "urbackup" to "root". Now output is:

user@999.service - User Manager for UID 999
Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)
Drop-In: /lib/systemd/system/user@.service.d
└─timeout.conf
Active: active (running) since Thu 2018-09-13 14:20:27 CEST; 1h 0min ago
Main PID: 532 (systemd)
Status: "Startup finished in 967ms."
CGroup: /user.slice/user-999.slice/user@999.service
└─init.scope
β”œβ”€532 /lib/systemd/systemd --user
└─533 (sd-pam)

Sep 13 14:20:27 NAS systemd[532]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Sep 13 14:20:27 NAS systemd[532]: Starting D-Bus User Message Bus Socket.
Sep 13 14:20:27 NAS systemd[532]: Listening on GnuPG network certificate management daemon.
Sep 13 14:20:27 NAS systemd[532]: Listening on GnuPG cryptographic agent and passphrase cache.
Sep 13 14:20:27 NAS systemd[532]: Listening on D-Bus User Message Bus Socket.
Sep 13 14:20:27 NAS systemd[532]: Reached target Sockets.
Sep 13 14:20:27 NAS systemd[532]: Reached target Basic System.
Sep 13 14:20:27 NAS systemd[532]: Reached target Default.
Sep 13 14:20:27 NAS systemd[532]: Startup finished in 967ms.
Sep 13 14:20:27 NAS systemd[1]: Started User Manager for UID 999.

which looks better... "service pihole-FTL status" shows now:

● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Thu 2018-09-13 14:20:28 CEST; 1h 1min ago
Docs: man:systemd-sysv-generator(8)
Process: 404 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Sep 13 14:20:24 NAS systemd[1]: Starting LSB: pihole-FTL daemon...
Sep 13 14:20:25 NAS pihole-FTL[404]: Not running
Sep 13 14:20:26 NAS su[519]: Successful su for pihole by root
Sep 13 14:20:26 NAS su[519]: + ??? root:pihole
Sep 13 14:20:26 NAS su[519]: pam_unix(su:session): session opened for user pihole by (uid=0)
Sep 13 14:20:28 NAS pihole-FTL[404]: FTL started!
Sep 13 14:20:28 NAS systemd[1]: Started LSB: pihole-FTL daemon.

But on Admin console still "FTL offline". Any ideas?

Thank you for help!

Run pihole -d for a debug token. Also share the output of this command:

echo ">stats" | nc localhost 4711

Hello Mcat12 and thank you for your reply!
The output of " echo ">stats" | nc localhost 4711" is:

domains_being_blocked 133209
dns_queries_today 7034
ads_blocked_today 2206
ads_percentage_today 31.361956
unique_domains 902
queries_forwarded 4048
queries_cached 780
clients_ever_seen 16
unique_clients 16
dns_queries_all_types 7137
reply_NODATA 287
reply_NXDOMAIN 106
reply_CNAME 1007
reply_IP 2948
status enabled
---EOM---

The debug token is: 7ap897qzgs

Bye

It looks like the web interface should be working. What is the output of curl http://pi.hole/admin/api.php?summary

Hello, the output of "curl http://pi.hole/admin/api.php?summary" is:

{"domains_being_blocked":"132,397","dns_queries_today":"2,855","ads_blocked_today":"228","ads_percentage_today":"8.0","unique_domains":"588","queries_forwarded":"2,030","queries_cached":"597","clients_ever_seen":"10","unique_clients":"8","dns_queries_all_types":"2,934","reply_NODATA":"85","reply_NXDOMAIN":"18","reply_CNAME":"171","reply_IP":"492","status":"enabled","gravity_last_updated":{"file_exists":true,"absolute":1537064826,"relative":{"days":"0","hours":"06","minutes":"18"}}}

Maybe it is something wrong in a cache...?!
I have the same "wrong" view on every Windows-client...working with three different browsers...

Thank you and bye.

Hi,
I did that "curl http://pi.hole/admin/api.php?summary" on my NAS via putty...

Bye

Hello, just found something runnning "service lighttpd status -l":

Sep 16 22:05:54 NAS lighttpd[524]: sh: 1: pidof: Permission denied
Sep 16 22:05:54 NAS sudo[23945]: www-data : TTY=unknown ; PWD=/var/www/html/admin ; USER=root ; COMMAND=/usr/local/bin/pihole status web
Sep 16 22:05:54 NAS sudo[23945]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 16 22:05:54 NAS sudo[23945]: pam_unix(sudo:session): session closed for user root
Sep 16 22:05:58 NAS lighttpd[524]: sh: 1: pidof: Permission denied
Sep 16 22:05:58 NAS sudo[23968]: www-data : TTY=unknown ; PWD=/var/www/html/admin ; USER=root ; COMMAND=/usr/local/bin/pihole status web
Sep 16 22:05:58 NAS sudo[23968]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 16 22:05:58 NAS sudo[23968]: pam_unix(sudo:session): session closed for user root

What are the correct permission-setting (user:group) for "/usr/local/bin/pihole"? Now it is root:root...
I think the unsuccesfully install of "urbackup" totally borked my pihole...

Thank you very much for your help.

Those are fine permissions for the pihole file. Check /etc/sudoers.d/pihole for its permissions and contents.

Hello,
the permissions of "/etc/sudoers.d/pihole" is root:root 0440 (read-only even for root...is that correct...?!), its content:

# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Allows the WebUI to use Pi-hole commands
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
#
www-data ALL=NOPASSWD: /usr/local/bin/pihole

Thank you and bye.

Me again... What are the right permissions for "/var/www/html/admin"? Here everything belongs to root:root 0755... Permissions of "var/www/html" are www-data:www-data 0775...

Because of that " sh: 1: pidof: Permission denied" I think it must be a permission-problem somewhere...

Bye

Those are the correct permissions for the sudoers file (any other permissions would cause it to not work).
What are the permissions of /usr/bin/pidof and /usr/bin/pihole-FTL?

Hi Mcat, permission of "/usr/bin/pihole-FTL" are root:root 755, "/usr/bin/pidof" doesnt even exist, but I was able to find it in /bin/ with permissions root:root 777...

Should user "pihole" be a member of group "sudo"? Now it is only "pihole" and "www-data"...

Thank you and bye

No, neither pihole nor www-data should not be in sudo. Are you able to run pidof pihole-FTL?

Hello,
"pidof pihole-FTL" returns 12946... No I meant: has user "pihole" to be member of groups "pihole" and "www-data" and even "sudo"?

pihole should only be in the pihole and www-data groups. However, this is not relevant for this thread. PHP uses the www-data user, and does not interact with the pihole user except through FTL.

Thank you very much for your explanation!!!
As I already mentioned, I still learn linux and the learning curve is very steep for me...
Any other ideas how to fix "my" problem?

Bye

Your backup system seems to have messed up a lot of things. Try setting up Pi-hole on a fresh system.

1 Like