{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/107","labels_url":"https://api.github.com/repos/mholt/caddy/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/107/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/107/events","html_url":"https://github.com/mholt/caddy/issues/107","id":85553331,"number":107,"title":"Feature: Reload Config on signal","user":{"login":"pastjean","id":140675,"avatar_url":"https://avatars.githubusercontent.com/u/140675?v=3","gravatar_id":"","url":"https://api.github.com/users/pastjean","html_url":"https://github.com/pastjean","followers_url":"https://api.github.com/users/pastjean/followers","following_url":"https://api.github.com/users/pastjean/following{/other_user}","gists_url":"https://api.github.com/users/pastjean/gists{/gist_id}","starred_url":"https://api.github.com/users/pastjean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pastjean/subscriptions","organizations_url":"https://api.github.com/users/pastjean/orgs","repos_url":"https://api.github.com/users/pastjean/repos","events_url":"https://api.github.com/users/pastjean/events{/privacy}","received_events_url":"https://api.github.com/users/pastjean/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mholt/caddy/labels/suggestion","name":"suggestion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-05T15:01:26Z","updated_at":"2015-06-05T15:23:08Z","closed_at":null,"body":"I'd love caddy to reload the config file when receiving a signal,\r\n\r\nI would use caddy paired with [consul](consul.io) and hashicorp/consul-template to generate the config file and when something changes in consul the config file is regenerated, i would like to be able to tell caddy that it's config file changed and to reload it when this happens.\r\n\r\n__Use case:__\r\n\r\n- Consul in a docker container\r\n- Consul template running and generating a Caddyfile\r\n- Caddy in a docker container running with some proxy sites up (to other docker conainers)\r\n\r\n*Then:*\r\n\r\n- A new service gets up \r\n- Consul-template updates the caddyfile\r\n- Consul-template sends signal to caddy\r\n- Caddy reload the config"},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/109326439","html_url":"https://github.com/mholt/caddy/issues/107#issuecomment-109326439","issue_url":"https://api.github.com/repos/mholt/caddy/issues/107","id":109326439,"user":{"login":"pastjean","id":140675,"avatar_url":"https://avatars.githubusercontent.com/u/140675?v=3","gravatar_id":"","url":"https://api.github.com/users/pastjean","html_url":"https://github.com/pastjean","followers_url":"https://api.github.com/users/pastjean/followers","following_url":"https://api.github.com/users/pastjean/following{/other_user}","gists_url":"https://api.github.com/users/pastjean/gists{/gist_id}","starred_url":"https://api.github.com/users/pastjean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pastjean/subscriptions","organizations_url":"https://api.github.com/users/pastjean/orgs","repos_url":"https://api.github.com/users/pastjean/repos","events_url":"https://api.github.com/users/pastjean/events{/privacy}","received_events_url":"https://api.github.com/users/pastjean/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T15:23:08Z","updated_at":"2015-06-05T15:23:08Z","body":"I don't know how they handle it with other web servers, would need to poke in code, or they communicate through an api (listening on another port with an external tool) or they send a signal.\r\n\r\nApache: https://httpd.apache.org/docs/2.2/programs/apachectl.html (graceful option)\r\nNginx: http://nginx.org/en/docs/beginners_guide.html\r\n\r\n\r\n[From wikipedia](https://en.wikipedia.org/wiki/Unix_signal#SIGHUP)\r\n\r\n**SIGHUP**:\r\n> The SIGHUP signal is sent to a process when its controlling terminal is closed ...\r\n> ... Many daemons will reload their configuration files and reopen their logfiles instead of exiting when receiving this signal....\r\n\r\nI can check this a little, but the rest api to control Caddy is also a good plan"}}