Skip to content
This repository has been archived by the owner. It is now read-only.

nginx process not receiving SIGHUP #6

Closed
ToBeReplaced opened this issue Aug 21, 2014 · 5 comments
Closed

nginx process not receiving SIGHUP #6

ToBeReplaced opened this issue Aug 21, 2014 · 5 comments

Comments

@ToBeReplaced
Copy link

I tried to restart a running container whose config had changed with:
docker kill -s HUP <container>

However, this event does not turn up in:
docker logs <container>

And, the config was not applied to new requests.

How can I send "reload" to a running nginx container?

@yosifkit
Copy link
Member

How are you changing the config file in the running container? What does your docker run look like?

I did some tests with a volume mounted file and was able to change the 404 page or the port by editing the nginx.conf and then running docker kill -s 1 <container>. There was no indication in the output that nginx had reloaded (I was running it with docker run -it --rm -v dir:dir nginx to watch the std out/err).

@ToBeReplaced
Copy link
Author

Mine's a little complicated:

docker run -d --name=<name> -v my_nginx.conf:/etc/nginx.conf -v my.crt:/etc/my.crt -v my.key:/etc/my.key -v html:/usr/local/nginx/html --link=some-container:other-container --expose=443 -p 80 -p 443 nginx:1.7.1

I disabled SELinux and the problem persisted.

Do you observe the changes when running with the container detached (without -it)?

@yosifkit
Copy link
Member

I think I found the problem. I was mounting a directory with -v and you are mounting just a file. I tested doing -v with just the file and when I change the file on the host machine it does not reflect in the container (docker cp ng:/etc/nginx.conf ./nginx2.conf, then diff). This may be the limitation of -v with a file rather than a folder.

@yosifkit
Copy link
Member

This sounds like a case of moby/moby#6011

@ToBeReplaced
Copy link
Author

Oh, that's interesting. Thanks for tracking that down! I'm sure I'm doing similar things in other places as well.

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

No branches or pull requests

2 participants