Use systemd/journalctl for all logs

I do not agree. Like it or not, the large majority of distributions (would 90-95% of the distributions be an educated guess?) are using systemd as the init system.

It would be a great idea if the developers would create a number of log facilities for Pi-hole where there is always a "standard" for every distribution. However, the number of developers is limited, not only for development but also for maintenance.

I think that if you follow the majority, the developers have made a wise decision.

Sadly enough, I can only test it on my Pi 2, which holds a PiHole instance in a "production/family" environment.

Really said to must say that I can't help you testing.

My PR is designed to be fully compatible with non-systemd systems, especially since Pi-hole officially supports Alpine Linux, which uses openrc.

Let me clarify how Pi-hole does logging:

  • default: plaintext logs into /var/log/pihole/{FTL,pihole,webserver}.log
  • fallback: syslog

Optional logging paths added by my PR:

  • journald: can be enabled/disabled at compile time and is activated via the startup flag --log-json. This enables a unified log and searching via journalctl.
  • JSON: activated with the startup flag --log-json, designed for docker

I chose startup flags to not affect cross-platform sync and backups.

Both the journald and JSON logging paths are in addition to the plaintext logs. Plaintext logs would need to be explicitly disabled by setting files.log.* empty.

Keeping Pi-Hole away from SystemD would indeed satisfy all those people complaining that Pi-Hole is too much Linux-centric and sucks because it can't run on FreeBSD or for most people under OPNsense/pfSense which is a Router/Firewall OS based on FreeBSD :slight_smile:

I think if you keep things down to the core and for example just count Ubuntu instead of also counting Kubuntu/Lubuntu/Xubuntu/etc. that it's not as horrible as you make it look to be honest...

Aside from a distro like Devuan there are other distros like Slackware and Gentoo who simply will forever stay the way they have always been and that means SystemD-free :slight_smile:

Yes, systemd is used on most Linux's, but there are Linux's that do not use it. And BSD etc will never use it.

I think deliberately limiting yourself to a single "thing" like this is extraordinarily short-sighted - even if Pi-Hole doesn't work on BSD (for example) at the moment, forcing a dependency on systemd into it would be shooting oneself in the foot.

Taking a "this is what I use so this is what should be targeted" approach is not desirable for a system that should be as general as possible (regardless of whether "I like it or not")

I see the proposal of implementing a compile time option for those that want it - that's fair enough. But not a hard requirement

I don't think that that systemd is heaven on earth, but I think closer to heaven the Unix Sys V init.

I just El Goog; this came up:

systemd: Debian, Ubuntu, Fedora, Red Hat Enterprise Linux, CentOS / AlmaLinux / Rocky Linux, Arch Linux, openSUSE / SUSE Linux Enterprise, Linux Mint, Pop!_OS
non-systemd: Devuan, Alpine Linux, Void Linux, Artix Linux, Slackware, Gentoo / Funtoo, GNU Guix System, antiX, CRUX

I really do not understand why people want to stick to something from 50 years ago. Do they also drive a T-Ford? But if you want to stay there, fine with me. I moved on, and I think the majority of the world did also.

I think @darkexplosiveqwx came up with a perfect solution to keep everybody happy :+1:

1st Rule of The Internet : Don't compare computer stuff to cars! :wink:

And I don't know what you are quoting from El Goog; but you do not seem to be aware of all the SystemD controversy and all the... well... basically hate towards the developer of the thing ?!

It's not exactly something like let's say which networking config service should I use for my system or which e-mail or database service : It goes way beyond that!