Restartdns not found

with new pull last night restartdns can not be found

pihole6:/# pihole restartdns
  [โœ—] /usr/local/bin/pihole: line 195: service: command not found

On FTL version vDev-78a424b, pihole restartdns works for me on Ubuntu 22.04 LTS (Hyper-V)

its prob docker related

The official docker is based on alpine. I'd be highly surprised if service is a valid command in there. @PromoFaux @yubiuser

Correct, there is no service command inside the container, which is why this is falling over.

I think I stared looking at a way of changing this a while back but then got distracted by other things.

I noticed that one can tell pihole-FTL to restart via the API (which is how the web interface does it I assume) and wondered if we could hook into that from the command line.

The alternative is to create a dummy service wrapper that mimics a real service and use that to manually reload the process, much like we do in the v5 container.

We could surely offer an option like this but what do we actually want to achieve with it (read as: why do we want to restart)? If you change any config option that requires an FTL restart, then it will happen automatically. If the process is stuck/crashed, then it will likely not react on API calls, either.

Yeah, I'm interested to know what the use case is here.

Coming back to this before I start rebasing Add a wrapper/mock for the `service` command by PromoFaux ยท Pull Request #1453 ยท pi-hole/docker-pi-hole ยท GitHub

I think we are probably agreed that there is no need to call pihole restartdns inside a container (or perhaps even on bare metal?)

If so, I will abandon 1453 and maybe look at adding in a monkeypatch to disable pihole restartdns inside the container (as we do with checkout etc)

Yeah, I don't think this is necessary. You can still use systemctl on bare metal if you ever need to do this. But my understanding of containers is that they do one thing and if this thing needs to be restarted ... so restart the whole thing!

1 Like

So looking at things. I think maybe we can just kill off the restartDNS() function in the pihole script..

There are still two places that use it in the core repo, namely and - I guess these are two scripts that need some v6 love and probably don't need to use this function in future?

Thoughts on a postcard...