What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Entware Pi-hole directly on the router? Yes!

Turns out... I had a bug in my build script and it never properly deleted the binary from the previously built package, making it use the same binary for all packages...
Update the package and let me know if the issue is gone now.
Alright, no errors now! That was indeed the issue.

Going forward, the github page could be tweaked a bit, based on the learnings from this thread.

The process is running as the 'pihole' user since I added that yesterday, I guess that does not matter one way or another:
Code:
# ps wT |grep pihole
2038537 pihole   13244 S <  pihole-FTL -- -u pihole -g pihole
2038546 pihole   13244 S <  {database} pihole-FTL -- -u pihole -g pihole
2038547 pihole   13244 S <  {housekeeper} pihole-FTL -- -u pihole -g pihole
2038548 pihole   13244 S <  {dns-client} pihole-FTL -- -u pihole -g pihole
2038549 pihole   13244 S <  {timer} pihole-FTL -- -u pihole -g pihole
2038550 pihole   13244 S N  {civetweb-timer} pihole-FTL -- -u pihole -g pihole
2038551 pihole   13244 S N  {civetweb-master} pihole-FTL -- -u pihole -g pihole
2041886 pihole   13244 S N  {civetweb-worker} pihole-FTL -- -u pihole -g pihole
2041887 pihole   13244 S N  {civetweb-worker} pihole-FTL -- -u pihole -g pihole
2041888 pihole   13244 S N  {civetweb-worker} pihole-FTL -- -u pihole -g pihole
2041889 pihole   13244 S N  {civetweb-worker} pihole-FTL -- -u pihole -g pihole
2051731 admin     5980 S    grep pihole

A small software engineering tweak. Could you change the compile flags to strip the debug symbols, and perhaps also to use dynamic libraries as well? Sort of how the official entware binaries look, see nmap:
Code:
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/bin# file nmap
nmap: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /opt/lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/bin# file pihole-FTL
pihole-FTL: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=51bccd9df92de8a090037b8a93a08237a6ac2a52, with debug_info, not stripped
 
Last edited:
Going forward, the github page could be tweaked a bit, based on the learnings from this thread.
Added suggestion to add 'pihole' user.
See updated README, what else would you add here? Device/firmware specific stuff should go into wiki though.

The process is running as the 'pihole' user since I added that yesterday, I guess that does not matter one way or another:
It should basically run as any user, it will log a few errors (chown_pihole() function) about not finding 'pihole' user but as far as I can tell that doesn't impact anything.

A small software engineering tweak. Could you change the compile flags to strip the debug symbols, and perhaps also to use dynamic libraries as well?
Pretty sure Pi-hole developers made it static for a reason - to use library versions they know that work, forcing it to use older libraries might break the build. No idea why they are not stripping it though but there might be a reason too.
Forcing it to use dynamic libraries means I would have to build toolchains and a lot of libraries from the Entware repo almost each time I want to build my binary, that would increase build time from ~5 minutes to maybe an hour.
I'm using their Docker builder images for building to make sure everything is assembled as it should.
 
Last edited:
Added suggestion to add 'pihole' user.
See updated README, what else would you add here? Device/firmware specific stuff should go into wiki though.


It should basically run as any user, it will log a few errors (chown_pihole() function) about not finding 'pihole' user but as far as I can tell that doesn't impact anything.


Pretty sure Pi-hole developers made it static for a reason - to use library versions they know that work, forcing it to use older libraries might break the build. No idea why they are not stripping it though but there might be a reason too.
Forcing it to use dynamic libraries means I would have to build toolchains and a lot of libraries from the Entware repo almost each time I want to build my binary, that would increase build time from ~5 minutes to maybe an hour.
I'm using their Docker builder images for building to make sure everything is assembled as it should.

I'd also add the NTP issue discussion to the Wiki. I moved around scripts, so that NTP is definitely started first (I made it 15, while PiHole stuff is 95/96):
Code:
# ls -l /opt/etc/init.d/
total 52
-rw-r--r-- 1 admin root 2822 Mar 19  2021 rc.func
-rw-r--r-- 1 admin root 4068 Jul  7 17:50 rc.func.syslog-ng
-rwxr-xr-x 1 admin root  966 Mar 19  2021 rc.unslung
-rwxr-xr-x 1 admin root  250 May 22 21:55 S01syslog-ng
-rwxr-xr-x 1 admin root  217 Jan  8  2025 S02haveged
-rwxr-xr-x 1 admin root  232 May 23 04:17 S10cron
-rwxrwxrwx 1 admin root  480 Jun 20 11:52 S15ntpd
-rwxr-xr-x 1 admin root 1460 Aug 18  2023 S33vnstat
-rwxr-xr-x 1 admin root  212 Jun  1 08:03 S61unbound
-r-xr-xr-x 1 admin root 1060 Nov  1  2024 S90taildns
-rwxr-xr-x 1 admin root  726 Aug 15 11:22 S95extra-ip
-rwxr-xr-x 1 admin root  289 Jul 15 06:58 S96pihole-FTL
-rwxr-xr-x 1 admin root  314 Jul 10  2024 S99sysstat

The other Wiki item is the updated extra IP script that I posted here - Link.

There are also config changes to discuss if one uses a separate DNS IP.

I did not realize PiHole developers wanted everything static ...
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top