[squid-users] The best way to start | stop | reload | status

Amos Jeffries squid3 at treenet.co.nz
Thu Jul 6 14:52:47 UTC 2017


On 07/07/17 01:08, erdosain9 wrote:
> Hi.
> mmm... im having a doubt.
> I usually use Systemctl for start, stop, reload, and status; but sometimes i
> heard that it was not the best way to do these actions.
> Way? I heard something wrong?

Because systemctl is a daemon manager. The "squid" binary is also a 
daemon manager. Having a daemon manager manage another daemon manager 
leads to some very odd behaviours.

People are finding out the hard way what those problems are since 
systemd merged daemon management into the init system on many OS.

NP: In Squid-4 we have completely redesigned the way Squid processes 
integrate so that it can be run under a different daemon manager.


> And if not the best way, what would it be?
> 
> 1) squid -z
> 2) squid
> 
> ???
> 

The squid -k options. See 
<http://www.squid-cache.org/Versions/v3/3.5/manuals/squid.html>

NP: -z is to format or repair the cache_dir storage area(s).


> And from there, how i can stop and reload, status??

"squid -k check" for status, it will exit with an error message if Squid 
is not running, and succeed if one is running.

The others should be obvious from the above documentation manual.


> And, if this is the best way, how do I start Squid automatically when the
> system boots?

If you are using a packaged binary the vendor should have setup 
appropriate integration to be installed already.

Otherwise, the tools/ directory in Squid source bundles contain whatever 
is needed for integration into the various init systems that version of 
Squid can be used with. For Squid-3 that is any init system that 
supports rc.d scripting.

Amos


More information about the squid-users mailing list