Allow for named pipe in syslog

I'd love to enter a feature request, but until discord believes I've earned enough cool points, I'll put this here.

Basically, I'd like to request a feature in pi-hole that allows for the pihole.log file to be a named pipe. As I mention in the article this change enables sending syslog to a remote server for collection, on device troubleshooting as the logs can still be viewed from the pipe, and less wear on the storage device.

I have a working example in the article. I just recently upgraded to 5.2.2 and I'll document the changes required to maintain the configuration.

A few comments on your approach:

"Update 01-pihole.conf to send syslogs to local"

As clearly noted in that file you shouldn't be editing that file.

###############################################################################
#      FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE.      #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#        IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN:          #
#                      /etc/pihole/setupVars.conf                             #
#                                                                             #
#        ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE           #
#                    WITHIN /etc/dnsmasq.d/yourname.conf                      #
###############################################################################

Have you considered using a symlink instead?

Note: the amount of wear and tear on an SD card from the dnsmasq log is trivial.

@jfb thanks for the feedback.

I tried to play by the rules...

$ pihole debug
.......

*** [ DIAGNOSING ]: Pi-hole diagnosis messages
id timestamp type message blob1 blob2 blob3 blob4 blob5


1 2020-12-29 19:57:45 DNSMASQ_CONFIG illegal repeated keyword at line 1 of /etc/dnsmasq.d/02-piho

$ cat /etc/dnsmasq.d/02-pihole.conf
log-facility=local5

maybe it's broken, though it's still likely I've fat fingered something. Reading this post led me to believe that I could set this value in a subsequent file, but it seems that pihole doesn't like it if it sees it twice?

With regard to your suggestion to "use a symlink" can you provide a bit more details?

A symlink is similar to an alias:

Yep, totally understand symlinks, my question was, how would that solve my problem? The issue that I see is that if I set local5 as a facility for syslog (accepting the violation previously mentioned) then logging goes to syslog and control of the resulting file is removed from the control of pi-hole. Any rotating, pruning, truncated, could conflict with other system operations like logrotate.

How would a symlink help in this regard?

Thanks again for your feedback!

If you can convince dnsmasq to do it then it will fall naturally in to the pihole-FTL binary.

1 Like

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