{"action":"created","issue":{"url":"https://api.github.com/repos/joyent/containerpilot/issues/157","repository_url":"https://api.github.com/repos/joyent/containerpilot","labels_url":"https://api.github.com/repos/joyent/containerpilot/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/joyent/containerpilot/issues/157/comments","events_url":"https://api.github.com/repos/joyent/containerpilot/issues/157/events","html_url":"https://github.com/joyent/containerpilot/issues/157","id":154819434,"number":157,"title":"preStart a background process like consult template","user":{"login":"richard-mauri","id":15126243,"avatar_url":"https://avatars.githubusercontent.com/u/15126243?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-mauri","html_url":"https://github.com/richard-mauri","followers_url":"https://api.github.com/users/richard-mauri/followers","following_url":"https://api.github.com/users/richard-mauri/following{/other_user}","gists_url":"https://api.github.com/users/richard-mauri/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-mauri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-mauri/subscriptions","organizations_url":"https://api.github.com/users/richard-mauri/orgs","repos_url":"https://api.github.com/users/richard-mauri/repos","events_url":"https://api.github.com/users/richard-mauri/events{/privacy}","received_events_url":"https://api.github.com/users/richard-mauri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joyent/containerpilot/labels/proposal","name":"proposal","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-13T23:35:26Z","updated_at":"2016-05-16T17:14:19Z","closed_at":null,"body":"Currently we are using a task to periodically (like 1m) run consul-template -once ... to generate an nginx config with all our discovered services in consul. This works, but at cost of lots of process thrashing. We think it should be better; like having consul template long running with a wait interval instead.\r\nNow, the list of services is not known ahead of time so using onStart to kick off consul template and onChange for each service is not appropriate.\r\n\r\nIs there or can there be a way to have like preStart launch a bg process like consultemplate with samelifeycle as the shimmed app (in our case nginx) ?"},"comment":{"url":"https://api.github.com/repos/joyent/containerpilot/issues/comments/219484870","html_url":"https://github.com/joyent/containerpilot/issues/157#issuecomment-219484870","issue_url":"https://api.github.com/repos/joyent/containerpilot/issues/157","id":219484870,"user":{"login":"richard-mauri","id":15126243,"avatar_url":"https://avatars.githubusercontent.com/u/15126243?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-mauri","html_url":"https://github.com/richard-mauri","followers_url":"https://api.github.com/users/richard-mauri/followers","following_url":"https://api.github.com/users/richard-mauri/following{/other_user}","gists_url":"https://api.github.com/users/richard-mauri/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-mauri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-mauri/subscriptions","organizations_url":"https://api.github.com/users/richard-mauri/orgs","repos_url":"https://api.github.com/users/richard-mauri/repos","events_url":"https://api.github.com/users/richard-mauri/events{/privacy}","received_events_url":"https://api.github.com/users/richard-mauri/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T17:14:18Z","updated_at":"2016-05-16T17:14:18Z","body":"Thanks for all participating in this thread so far. I want to share another idea that a colleague suggested is to ditch the consul template polling approach altogether and some how participate in the \"gossip protocol\" and receive events when services come and go from consul...."}}