I am currently writing a program that will control the launch of squid server, in which I use fork-exec to launch squid server with non-background mode and with designated configuration file. And in the main process, I will periodically reload the squid server by sending signal to the child process.
However, it seems like that it doesn't work for me to reload the squid process by using "kill -HUP". So later I tried to verify if the "SIGHUP" is really working for reloading squid server by launching the server in a separate shell, and it doesn't work too.
So am i wrong with reloading squid server?
In the implementation I use kill command with SIGHUP to restart the server with child process id (followed by what systemd configuration of squid tells me how to reload the squid, https://github.com/squid-cache/squid/blob/master/tools/systemd/squid.service).
expected: I can reload squid with kill -HUP any times in my main process. actual: failed with reloading, and the child process will exit when I send SIGHUP.
By looking into the cache.log file, I find out that the squid only recognize full path for the configuration file. So just type full path of file when launch the squid, and it will successfully reload with the same configuration when you send HUP signal to the squid process.