{"action":"opened","issue":{"url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/50","repository_url":"https://api.github.com/repos/palantir/gradle-java-distribution","labels_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/50/comments","events_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/50/events","html_url":"https://github.com/palantir/gradle-java-distribution/issues/50","id":133286521,"number":50,"title":"Stop command should kill whole process group","user":{"login":"punya","id":277514,"avatar_url":"https://avatars.githubusercontent.com/u/277514?v=3","gravatar_id":"","url":"https://api.github.com/users/punya","html_url":"https://github.com/punya","followers_url":"https://api.github.com/users/punya/followers","following_url":"https://api.github.com/users/punya/following{/other_user}","gists_url":"https://api.github.com/users/punya/gists{/gist_id}","starred_url":"https://api.github.com/users/punya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punya/subscriptions","organizations_url":"https://api.github.com/users/punya/orgs","repos_url":"https://api.github.com/users/punya/repos","events_url":"https://api.github.com/users/punya/events{/privacy}","received_events_url":"https://api.github.com/users/punya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-12T16:41:38Z","updated_at":"2016-02-12T16:41:38Z","closed_at":null,"body":"If the top-level (daemonized) service starts one or more long-running child processes, it has to ensure that those child processes get killed when the parent process is killed. This is somewhat painful to do in Java because it involves setting a shutdown hook, and it's repetitive work that's easy to get wrong. If done incorrectly, the child processes become zombies and have to be reaped manually by other means; they could take up system resources such as memory and ports.\r\n\r\nInstead, if `init.sh` were to record the process group ID and `kill` the process group, we'd have a clean solution that works without additional work from the app.\r\n\r\nTagging @mingyukim, @tomkozlowski and @gdearment for comments."}}