{"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":4,"created_at":"2015-06-05T15:01:26Z","updated_at":"2015-06-05T15:58:03Z","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/109340519","html_url":"https://github.com/mholt/caddy/issues/107#issuecomment-109340519","issue_url":"https://api.github.com/repos/mholt/caddy/issues/107","id":109340519,"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:58:03Z","updated_at":"2015-06-05T15:58:03Z","body":"In apache from `./include/mpm_common.h`\r\n```c\r\n/* Signal used to gracefully restart */\r\n#define AP_SIG_GRACEFUL SIGUSR1\r\n````\r\n\r\nFrom mod_so.c\r\n```\r\n * This module is used to load Apache modules at runtime. This means that the\r\n * server functionality can be extended without recompiling and even without\r\n * taking the server down at all. Only a HUP or AP_SIG_GRACEFUL signal\r\n * needs to be sent to the server to reload the dynamically loaded modules.\r\n *\r\n```\r\n\r\nSo I guess those 2 signals (HUP and USR1) are used. I've seen occurences where in windows they use something else\r\n\r\nBut i also like the idea of the rest api to control the server"}}