Re: Validate Config before reload

<[email protected]> Tue, 24 Sep 2024 09:00:44 +0300
Newsgroups gmane.comp.web.squid.devel
Message-ID <[email protected]>
Hey,

My recommendation is to validation the when downloading it before testing the config.
I have a ready to use lists syntax and duplication validation tools.
If you need just let me know what type of ACL you are using and I can publish the sources later on.

Eliezer

-----Original Message-----
From: squid-dev <[email protected]> On Behalf Of Stuart Henderson
Sent: Monday, September 23, 2024 2:28 PM
To: [email protected]
Subject: Re: [squid-dev] Validate Config before reload

On 2024-09-23, Rick Rackow <[email protected]> wrote:
> Hey Team,
> We have the following scenario: we get a list of IPs from an external service, add them to our squid ACLs via a cronjob and then in the same cronjob also reload squid. In this scenario it can happen that occasionally we get some nonsense response from the external service and that lands in the config, causing the config file to be invalid. Now if we to `systemctl reload squid` squid crashes on the restart because the config is invalid and thereafter can’t be restarted without explicitly stating `systemctl start squid`. 
>
> The question is, has it been considered to validate the config file before performing the actual reload, so there’s no disruption to squid if there was a working config beforehand?

That's easy to do from your cronjob: write the new config to a temporary
file, check it with "squid -f $filename -k parse", only move into place
and reload if ok.


_______________________________________________
squid-dev mailing list
[email protected]
https://lists.squid-cache.org/listinfo/squid-dev

_______________________________________________
squid-dev mailing list
[email protected]
https://lists.squid-cache.org/listinfo/squid-dev