Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload the Squid configuration on a running instance #48

Open
jackmiemie opened this issue Apr 25, 2018 · 1 comment
Open

Reload the Squid configuration on a running instance #48

jackmiemie opened this issue Apr 25, 2018 · 1 comment

Comments

@jackmiemie
Copy link

Hi,

This is a suggestion to revise the method to reload the squid configuration on a running instance.

I have used sameersbn/squid:3.3.8-23 and it work nice until I try to reload the squid configuration on a running instance. I found that after typing docker kill -s HUP squid to my terminal, squid shows the same configuration as before. I try a lot of ways to figure out the problem, but only to find that it was the problem of mounting the squid.conf.

Here is the detail.

I create and run sameersbn/squid:3.3.8-23 following the instruction in README.md:

docker run -d --name squid --restart=always --publish 3128:3128 --volume /etc/squid/squid.conf:/etc/squid3/squid.conf --volume /var/spool/squid3:/var/spool/squid3 sameersbn/squid:3.3.8-23

This works nice, however, when you try to reload squid.conf on the running instance using:

docker kill -s HUP squid

You will find the configuration of squid doesn't change at all. After a lot of miserable reading of docker issues, I found the problem. Docker can not detect the mounted file changes unless you mount the directory. In my situation, I create a new container and mount my squid.conf directory, then HUP works. That is:

docker run -d --name squid --restart=always --publish 3128:3128 --volume /etc/squid/squid.conf:/etc/squid3/squid.conf --volume /etc/squid:/etc/squid3 --volume /var/spool/squid3:/var/spool/squid3 sameersbn/squid:3.3.8-23

The magic is --volume /etc/squid:/etc/squid3

I hope my experience could help new guys like me. 😃

@helphi
Copy link

helphi commented Jul 17, 2020

Try mount volume only as directory:

docker run -p 3128:3128  -v /etc/squid:/etc/squid sameersbn/squid:3.5.27-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants