I haven't setup squid in about a decade.
For some reason, squid is being started before DNS is available, so you need to
a) determine which DNS you are using (systemd-resolved is likely)
b) make the startup of squid depend on the DNS setup/resolver in the squid.service file
That will fix this issue, but it won't fix any squid config issues.
It works manually, because by the time you ssh into the system, DNS + networking are up.
Squid should come with a systemd-service "Unit" definition. Find that file .... I'd use 'locate squid.service', then ensure the
in the unit file points at the DNS service.
If you need to check the existance of a file, we can use:
Code:
ConditionPathExists=/etc/path/to/some file
Examples of both these settings are in the /etc/systemd/system/sshd.service file.
The network-online.target.wants/networking.service file has some interesting examples too and how multiple dependent services can be required.
Bookmarks