starting squid with systemctl

516 views Asked by At

I have a system (debian) connected to a broadband link. It collects a DHCP address from link, which is how it accesses DNS.

The system also includes squid (3) which handles some requests.

It all works perfectly, until I reboot it. Then squid fails to startup correctly. restarting squid clears the problem.

The reason appears to be that squid is starting too soon - before DNS is set up, which causes it reject any requests (although, when it received the request DNS is now set up).

I tried delaying squid using systemctl to wait for network-online.target, but even that is too soon.

Has anyone got any ideas/tip of how to use systemctl/etc to solve this (I would rather not interpose a script which does a delay 30 before starting it, but perhaps that is the only way?)

I think I either need a dns-is-available.target or a delay-30-seconds-after-network-online.target ... or some clever thinking.

Monathan

0

There are 0 answers