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?
And if not the best way, what would it be?
1) squid -z
And from there, how i can stop and reload, status??
And, if this is the best way, how do I start Squid automatically when the system boots?
squid -k check|reconfigure etc for interaction
with squid process. Reconfigure is for reload config files,
external ACL files, as well as for i.e. refreshing cached group
members in case if external ACL used.
Usually, the best way to start/stop/restart squid is to use your
init, i.e. systemctl stop squid, service squid stop,
/etc/init.d/squid stop. Depending of distro, squid usually has
systemd-unit-file or upstart/init script. For reload
configuration, personally I always use squid -k reconfigure.
But if you want to/need to, you do not have to
run squid as a daemon/service, you can start it via cron or
whatever you like. Init is usually the best way, since it
handles things like order, dependiencies, runlevels etc. - that
is what is it for.
On 07/07/17 01:08, erdosain9 wrote:
> 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
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.