{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/2150","repository_url":"https://api.github.com/repos/mholt/caddy","labels_url":"https://api.github.com/repos/mholt/caddy/issues/2150/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/2150/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/2150/events","html_url":"https://github.com/mholt/caddy/issues/2150","id":319753245,"number":2150,"title":"Signal handling when used as a lib","user":{"login":"sssilver","id":619878,"avatar_url":"https://avatars2.githubusercontent.com/u/619878?v=4","gravatar_id":"","url":"https://api.github.com/users/sssilver","html_url":"https://github.com/sssilver","followers_url":"https://api.github.com/users/sssilver/followers","following_url":"https://api.github.com/users/sssilver/following{/other_user}","gists_url":"https://api.github.com/users/sssilver/gists{/gist_id}","starred_url":"https://api.github.com/users/sssilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sssilver/subscriptions","organizations_url":"https://api.github.com/users/sssilver/orgs","repos_url":"https://api.github.com/users/sssilver/repos","events_url":"https://api.github.com/users/sssilver/events{/privacy}","received_events_url":"https://api.github.com/users/sssilver/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-03T00:15:56Z","updated_at":"2018-05-03T06:18:09Z","closed_at":"2018-05-03T02:20:40Z","author_association":"NONE","body":"### 1. What version of Caddy are you using (`caddy -version`)?\r\nv0.10.14\r\n\r\n### 2. What are you trying to do?\r\n`cloudflared` imports github.com/coredns/coredns, which imports github.com/mholt/caddy.\r\n\r\nIt looks like caddy installs its own signal handler for SIGTERM/SIGINT/etc, and since in UNIX/Linux there can only be one handler per process for these signals, that causes our own handlers in cloudflared to not get triggered.\r\n\r\nThe signal handler stuff in caddy makes sense for situations when it's being ran as a server, however when it's being used as a lib, it should probably be more mindful of what the parent code may choose to do with its own signal handlers.\r\n\r\nFor now, we have just commented out `trapSignalsCrossPlatform()` and some handlers in `trapSignalsPosix` that we actually wanna handle in our own codebase. However, this is not a long-term solution. Ideally, we would be able to just pull caddy from the origin and use it without having this issue.\r\n\r\nIf you have ideas around how this could be addressed, we don't mind implementing the solution and opening a PR."},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/386200526","html_url":"https://github.com/mholt/caddy/issues/2150#issuecomment-386200526","issue_url":"https://api.github.com/repos/mholt/caddy/issues/2150","id":386200526,"user":{"login":"sssilver","id":619878,"avatar_url":"https://avatars2.githubusercontent.com/u/619878?v=4","gravatar_id":"","url":"https://api.github.com/users/sssilver","html_url":"https://github.com/sssilver","followers_url":"https://api.github.com/users/sssilver/followers","following_url":"https://api.github.com/users/sssilver/following{/other_user}","gists_url":"https://api.github.com/users/sssilver/gists{/gist_id}","starred_url":"https://api.github.com/users/sssilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sssilver/subscriptions","organizations_url":"https://api.github.com/users/sssilver/orgs","repos_url":"https://api.github.com/users/sssilver/repos","events_url":"https://api.github.com/users/sssilver/events{/privacy}","received_events_url":"https://api.github.com/users/sssilver/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T06:18:09Z","updated_at":"2018-05-03T06:18:09Z","author_association":"NONE","body":"Thanks--this helps a lot! I've filed an issue with CoreDNS."}}
{"actor":{"display_login":"sssilver"}}