Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of /s6-init breaks entrypoint overrides #1701

Open
troykelly opened this issue Feb 18, 2025 · 14 comments
Open

Removal of /s6-init breaks entrypoint overrides #1701

troykelly opened this issue Feb 18, 2025 · 14 comments
Labels
never-stale Use this label to ensure the stale action does not close this issue

Comments

@troykelly
Copy link

Versions

Core version is v6.0 (Latest: v6.0)
Web version is v6.0 (Latest: v6.0)
FTL version is v6.0 (Latest: v6.0)

Platform

  • OS and version: Debian GNU/Linux 11
  • Platform: Docker

Expected behavior

Anybody with old entrypoint overrides will be calling /s6-init as the last command to allow the container to continue to start as intended, ie:

    entrypoint: |
      /bin/sh -c 
      "echo 'server=/61.10.in-addr.arpa./127.0.0.1#953' > /etc/dnsmasq.d/02-custom.conf &&
       echo 'server=/an.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       echo 'server=/another.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       echo 'server=/yet.another.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       exec /s6-init"

Actual behavior / bug

Without the former startup file, pihole keeps restarting.

Steps to reproduce

Steps to reproduce the behavior:

  1. Override entrypoint on container
  2. Start container

Debug Token

  • URL: N/A

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

I can't see anything announced that the startup entrypoint was changing, but using the new entrypoint resolves the issue.

To resolve this issue, use start.sh

    entrypoint: |
      /bin/sh -c 
      "echo 'server=/61.10.in-addr.arpa./127.0.0.1#953' > /etc/dnsmasq.d/02-custom.conf &&
       echo 'server=/an.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       echo 'server=/another.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       echo 'server=/yet.another.example.invalid./127.0.0.1#953' >> /etc/dnsmasq.d/02-custom.conf && 
       exec /usr/bin/start.sh"

Yes, this isn't the greatest hack - but there's no way to persist minor config settings like this without shared volumes, so creating this file on startup is the only real solution.

@PromoFaux PromoFaux transferred this issue from pi-hole/pi-hole Feb 18, 2025
@PromoFaux PromoFaux added the never-stale Use this label to ensure the stale action does not close this issue label Feb 18, 2025
@PromoFaux
Copy link
Member

Thanks, I'll leave this open in case someone else has a similar issue - though I'm not sure how many folk were doing this.

Interesting way around an issue, though. Any reason why you're not just using a volume mount for /etc/dnsmasq.d?

@PromoFaux
Copy link
Member

An alternative solution for you, as i've just learned about the existence of this config option

Image

Setting via the web interface stores it in the config file like so:

 dnsmasq_lines = [
    "server=/61.10.in-addr.arpa./127.0.0.1#953",
    "server=/an.example.invalid./127.0.0.1#953"
  ] ### CHANGED, default = []

This could also be set by the environment variable FTLCONF_misc_dnsmasq_lines, although I'm currently struggling to get a value to stick when setting it this way. @DL6ER What is the correct format to pass this in via the environment?

@troykelly
Copy link
Author

@PromoFaux have you tried that - because the "=" breaks it.
I spent hours on it this morning trying every possible combo, and I can't get "FTLCONF_misc_dnsmasq_lines" to add anything other than [server, server, "server, 'server

@troykelly
Copy link
Author

Thanks, I'll leave this open in case someone else has a similar issue - though I'm not sure how many folk were doing this.

Interesting way around an issue, though. Any reason why you're not just using a volume mount for /etc/dnsmasq.d?

It's "permanent" (in this environment) and the VM's that run pihole only have ephemeral storage, so, rather than giving it a gluster volume for that tiny little file - I have been creating it on start.

FTLCONF_misc_dnsmasq_lines would be an awesome fix for our hack, but the equals in the string breaks the parsing, so I can't put lines like server=1.2.3 in it.

@PromoFaux
Copy link
Member

PromoFaux commented Feb 19, 2025

have you tried that - because the "=" breaks it.

Yeah, sorry - that's what I meant by:

, although I'm currently struggling to get a value to stick when setting it this way

FTLCONF_misc_dnsmasq_lines would be an awesome fix

Lets see what DL comes back with...

@troykelly
Copy link
Author

have you tried that - because the "=" breaks it.

Yeah, sorry - that's what I meant by:

, although I'm currently struggling to get a value to stick when setting it this way

AH! Sorry!

Yeah - I've tried (what I think is?) every possible iteration of single, double quotes, list/sequence, mapping - I just can't get anything past the "="

@rdwebdesign
Copy link
Member

The value is passed to the container.

Inside the container there will be a variable with the value, like:

FTLCONF_misc_dnsmasq_lines=server=/61.10.in-addr.arpa./127.0.0.1#953;server=/an.example.invalid./127.0.0.1#953

But FTL is not correctly parsing values with = and only the initial part (before the equal sign) is written in the file.

@troykelly
Copy link
Author

But FTL is not correctly parsing values with = and only the initial part (before the equal sign) is written in the file.

@rdwebdesign Do you want me to create a new ticket for that?

@rdwebdesign
Copy link
Member

No need for another issue.
I was just explaining the results of my tests.

We are aware of the issue and we will fix it when we have the time to dig into the code. Just be patient.

@troykelly
Copy link
Author

Just be patient

@rdwebdesign appreciate it - thank you.
No urgency needed - the workaround is fine.

@yubiuser
Copy link
Member

@yubiuser
Copy link
Member

Fix for the env setting at pi-hole/FTL#2204

@instantdreams
Copy link

Same issue as #1718

@PromoFaux
Copy link
Member

@troykelly - the latest tag should fix this issue. Please let us know! https://github.com/pi-hole/docker-pi-hole/releases/tag/2025.02.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never-stale Use this label to ensure the stale action does not close this issue
Projects
None yet
Development

No branches or pull requests

5 participants