Pi-hole not running after reboot on power-issues

Reviving this discussion as I now have the same issue:

  1. Clean reboot is fine
  2. Brown out (power outtage) means pihole-FTL doesn't load correctly
  3. Restarting (not starting) pihole-FTL fixes the issue

After brownout:

$ systemctl status pihole-FTL
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated)
   Active: active (exited) since Fri 2020-10-23 19:14:32 UTC; 24min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1004 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Oct 23 19:14:31 nuc systemd[1]: Starting LSB: pihole-FTL daemon...
Oct 23 19:14:32 nuc pihole-FTL[1004]: Not running
Oct 23 19:14:32 nuc su[1079]: Successful su for pihole by root
Oct 23 19:14:32 nuc su[1079]: + ??? root:pihole
Oct 23 19:14:32 nuc su[1079]: pam_unix(su:session): session opened for user pihole by (uid=0)
Oct 23 19:14:32 nuc pihole-FTL[1004]: dnsmasq: unknown interface eno1
Oct 23 19:14:32 nuc su[1079]: pam_unix(su:session): session closed for user pihole
Oct 23 19:14:32 nuc systemd[1]: Started LSB: pihole-FTL daemon.

If I run $ ps ax | grep pihole | grep -v grep nothing shows i.e. pihole-FTL is not running.

If I run $ sudo systemctl restart pihole-FTL:

$ systemctl status pihole-FTL
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated)
   Active: active (exited) since Fri 2020-10-23 19:40:05 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2592 ExecStop=/etc/init.d/pihole-FTL stop (code=exited, status=0/SUCCESS)
  Process: 2606 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Oct 23 19:40:05 nuc systemd[1]: Starting LSB: pihole-FTL daemon...
Oct 23 19:40:05 nuc pihole-FTL[2606]: Not running
Oct 23 19:40:05 nuc su[2637]: Successful su for pihole by root
Oct 23 19:40:05 nuc su[2637]: + ??? root:pihole
Oct 23 19:40:05 nuc su[2637]: pam_unix(su:session): session opened for u
Oct 23 19:40:05 nuc pihole-FTL[2606]: FTL started!
Oct 23 19:40:05 nuc su[2637]: pam_unix(su:session): session closed for u
Oct 23 19:40:05 nuc systemd[1]: Started LSB: pihole-FTL daemon.

Which works as expected:

$ ps ax | grep pihole | grep -v grep
 2665 ?        S<l    0:01 /usr/bin/pihole-FTL

/var/log/pihole-FTL.log

When a power outtage happens, the end of the logfile (when it doesn't load correctly) is:

[2020-10-23 19:14:32.911 1366M] Imported 12643 queries from the long-term database
[2020-10-23 19:14:32.911 1366M]  -> Total DNS queries: 12643
[2020-10-23 19:14:32.911 1366M]  -> Cached DNS queries: 2467
[2020-10-23 19:14:32.911 1366M]  -> Forwarded DNS queries: 9671
[2020-10-23 19:14:32.911 1366M]  -> Blocked DNS queries: 505
[2020-10-23 19:14:32.911 1366M]  -> Unknown DNS queries: 0
[2020-10-23 19:14:32.911 1366M]  -> Unique domains: 785
[2020-10-23 19:14:32.911 1366M]  -> Unique clients: 38
[2020-10-23 19:14:32.911 1366M]  -> Known forward destinations: 2
[2020-10-23 19:14:32.911 1366M] Successfully accessed setupVars.conf

After a restart this shows:

[2020-10-23 19:40:05.411 2663M] Imported 12262 queries from the long-term database
[2020-10-23 19:40:05.411 2663M]  -> Total DNS queries: 12262
[2020-10-23 19:40:05.411 2663M]  -> Cached DNS queries: 2393
[2020-10-23 19:40:05.411 2663M]  -> Forwarded DNS queries: 9376
[2020-10-23 19:40:05.411 2663M]  -> Blocked DNS queries: 493
[2020-10-23 19:40:05.411 2663M]  -> Unknown DNS queries: 0
[2020-10-23 19:40:05.411 2663M]  -> Unique domains: 762
[2020-10-23 19:40:05.411 2663M]  -> Unique clients: 38
[2020-10-23 19:40:05.411 2663M]  -> Known forward destinations: 2
[2020-10-23 19:40:05.411 2663M] Successfully accessed setupVars.conf
[2020-10-23 19:40:05.412 2665M] PID of FTL process: 2665
[2020-10-23 19:40:05.412 2665/T2666] Listening on port 4711 for incoming IPv4 telnet connections
[2020-10-23 19:40:05.413 2665/T2668] Listening on Unix socket
[2020-10-23 19:40:05.413 2665/T2667] Listening on port 4711 for incoming IPv6 telnet connections
[2020-10-23 19:40:05.419 2665M] Reloading DNS cache
[2020-10-23 19:40:05.419 2665M] Blocking status is enabled
[2020-10-23 19:40:05.446 2665M] INFO: No regex blacklist entries found
[2020-10-23 19:40:05.446 2665M] INFO: No regex whitelist entries found
[2020-10-23 19:40:05.449 2665M] Compiled 0 whitelist and 0 blacklist regex filters for 38 clients in 3.1 msec

ie. there is no PID assigned after a power outtage - which makes sense given there is no process running.

Has anyone else experienced this/know a fix? It's pretty debilitating as I'm not always at home when there is a power outtage (they are quite common) and I have to essentially add backup DNS servers which defeats the point of pihole.

I could implement a script on a crontab every 10 minutes to check for the pihole-FTL process, and issue the restart command, but that is messy and overkill.

A

(Please consider before reviving a 2017 topic that would match your issue only vaguely, e.g. you are not on the 2017 version - pihole-FTL was introduced in 2018. I've moved your post into a new topic.)

pihole-FTL cannot start because its network interface isn't available.
You should investigate your network startup sequence, e.g. in init.d or your cron jobs (maybe that's a USB ethernet dongle that's late in being initialised)?

If you can't spot anything unusual, you could try to delay Pi-hole's startup by adding DELAY_STARTUP to /etc/pihole/pihole-FTL.conf.

Brilliant, that's solved it! I didn't notice that error - thank you very much!

For the record I'm running Ubuntu 18.04.5 LTS on an Intel NUC, built-in ethernet.

Glad that worked for you. :slight_smile:

You should consider setting a delay as being a simple band-aid, though. It covers the wound, but it may not stop the bleeding.
Your real issue might be still with your network startup sequence, which may well affect you in other ways beyond Pi-hole.

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