{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/comments/53706073","id":53706073,"diff_hunk":"@@ -279,6 +279,38 @@ class JavaDistributionPluginTests extends Specification {\n             .find({it.name.endsWith(\"-manifest-classpath-0.1.jar\")})\n     }\n \n+    def 'kills children spawned by service'() {\n+        given:\n+        createUntarBuildFile(buildFile)\n+\n+        temporaryFolder.newFolder('src', 'main', 'java', 'test')\n+        temporaryFolder.newFile('src/main/java/test/Test.java') << '''\n+        package test;\n+        public class Test {\n+            public static void main(String[] args) throws Exception {\n+                Runtime.exec(\"yes\");\n+                while(true);\n+            }\n+        }\n+        '''.stripIndent()\n+\n+        when:\n+        BuildResult buildResult = run('build', 'distTar', 'untar').build()\n+\n+        then:\n+        buildResult.task(':build').outcome == TaskOutcome.SUCCESS\n+        buildResult.task(':distTar').outcome == TaskOutcome.SUCCESS\n+        buildResult.task(':untar').outcome == TaskOutcome.SUCCESS\n+\n+        // check content was extracted\n+        new File(projectDir, 'dist/service-name-0.1').exists()\n+\n+        // try all of the service commands\n+        String output = exec('dist/service-name-0.1/service/bin/init.sh', 'start')\n+        exec('dist/service-name-0.1/service/bin/init.sh', 'stop')\n+        exec(\"ps aux | grep '[y]es'\").trim() == \"\"","path":"src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy","position":33,"original_position":33,"commit_id":"2d33e7fc0739e1f8149cd25f9858f66b9f31f5b8","original_commit_id":"2d33e7fc0739e1f8149cd25f9858f66b9f31f5b8","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},"body":"Yeah, I found this trick on a Stackoverflow page.","created_at":"2016-02-22T22:38:30Z","updated_at":"2016-02-22T22:38:30Z","html_url":"https://github.com/palantir/gradle-java-distribution/pull/51#discussion_r53706073","pull_request_url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/comments/53706073"},"html":{"href":"https://github.com/palantir/gradle-java-distribution/pull/51#discussion_r53706073"},"pull_request":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51","id":59429765,"html_url":"https://github.com/palantir/gradle-java-distribution/pull/51","diff_url":"https://github.com/palantir/gradle-java-distribution/pull/51.diff","patch_url":"https://github.com/palantir/gradle-java-distribution/pull/51.patch","issue_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/51","number":51,"state":"open","locked":false,"title":"Kill whole group, not just parent","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},"body":"Fixes #50.","created_at":"2016-02-16T00:44:09Z","updated_at":"2016-02-22T22:38:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84239a703c7a6a33060129cf93f1cf29bebcaa3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51/commits","review_comments_url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51/comments","review_comment_url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/51/comments","statuses_url":"https://api.github.com/repos/palantir/gradle-java-distribution/statuses/2d33e7fc0739e1f8149cd25f9858f66b9f31f5b8","head":{"label":"punya:feature/kill-group","ref":"feature/kill-group","sha":"2d33e7fc0739e1f8149cd25f9858f66b9f31f5b8","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},"repo":{"id":51796492,"name":"gradle-java-distribution","full_name":"punya/gradle-java-distribution","owner":{"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},"private":false,"html_url":"https://github.com/punya/gradle-java-distribution","description":"a Gradle plugin that creates a standard Java distribution package with start scripts","fork":true,"url":"https://api.github.com/repos/punya/gradle-java-distribution","forks_url":"https://api.github.com/repos/punya/gradle-java-distribution/forks","keys_url":"https://api.github.com/repos/punya/gradle-java-distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/punya/gradle-java-distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/punya/gradle-java-distribution/teams","hooks_url":"https://api.github.com/repos/punya/gradle-java-distribution/hooks","issue_events_url":"https://api.github.com/repos/punya/gradle-java-distribution/issues/events{/number}","events_url":"https://api.github.com/repos/punya/gradle-java-distribution/events","assignees_url":"https://api.github.com/repos/punya/gradle-java-distribution/assignees{/user}","branches_url":"https://api.github.com/repos/punya/gradle-java-distribution/branches{/branch}","tags_url":"https://api.github.com/repos/punya/gradle-java-distribution/tags","blobs_url":"https://api.github.com/repos/punya/gradle-java-distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/punya/gradle-java-distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/punya/gradle-java-distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/punya/gradle-java-distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/punya/gradle-java-distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/punya/gradle-java-distribution/languages","stargazers_url":"https://api.github.com/repos/punya/gradle-java-distribution/stargazers","contributors_url":"https://api.github.com/repos/punya/gradle-java-distribution/contributors","subscribers_url":"https://api.github.com/repos/punya/gradle-java-distribution/subscribers","subscription_url":"https://api.github.com/repos/punya/gradle-java-distribution/subscription","commits_url":"https://api.github.com/repos/punya/gradle-java-distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/punya/gradle-java-distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/punya/gradle-java-distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/punya/gradle-java-distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/punya/gradle-java-distribution/contents/{+path}","compare_url":"https://api.github.com/repos/punya/gradle-java-distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/punya/gradle-java-distribution/merges","archive_url":"https://api.github.com/repos/punya/gradle-java-distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/punya/gradle-java-distribution/downloads","issues_url":"https://api.github.com/repos/punya/gradle-java-distribution/issues{/number}","pulls_url":"https://api.github.com/repos/punya/gradle-java-distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/punya/gradle-java-distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/punya/gradle-java-distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/punya/gradle-java-distribution/labels{/name}","releases_url":"https://api.github.com/repos/punya/gradle-java-distribution/releases{/id}","deployments_url":"https://api.github.com/repos/punya/gradle-java-distribution/deployments","created_at":"2016-02-16T00:43:20Z","updated_at":"2016-02-16T00:43:20Z","pushed_at":"2016-02-16T00:54:45Z","git_url":"git://github.com/punya/gradle-java-distribution.git","ssh_url":"git@github.com:punya/gradle-java-distribution.git","clone_url":"https://github.com/punya/gradle-java-distribution.git","svn_url":"https://github.com/punya/gradle-java-distribution","homepage":"","size":110,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"b5d2c60a3e9e59fa382a793c834eaf8dd23b5e54","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":41394255,"name":"gradle-java-distribution","full_name":"palantir/gradle-java-distribution","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/gradle-java-distribution","description":"a Gradle plugin that creates a standard Java distribution package with start scripts","fork":false,"url":"https://api.github.com/repos/palantir/gradle-java-distribution","forks_url":"https://api.github.com/repos/palantir/gradle-java-distribution/forks","keys_url":"https://api.github.com/repos/palantir/gradle-java-distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/gradle-java-distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/gradle-java-distribution/teams","hooks_url":"https://api.github.com/repos/palantir/gradle-java-distribution/hooks","issue_events_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/gradle-java-distribution/events","assignees_url":"https://api.github.com/repos/palantir/gradle-java-distribution/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/gradle-java-distribution/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/gradle-java-distribution/tags","blobs_url":"https://api.github.com/repos/palantir/gradle-java-distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/gradle-java-distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/gradle-java-distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/gradle-java-distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/gradle-java-distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/gradle-java-distribution/languages","stargazers_url":"https://api.github.com/repos/palantir/gradle-java-distribution/stargazers","contributors_url":"https://api.github.com/repos/palantir/gradle-java-distribution/contributors","subscribers_url":"https://api.github.com/repos/palantir/gradle-java-distribution/subscribers","subscription_url":"https://api.github.com/repos/palantir/gradle-java-distribution/subscription","commits_url":"https://api.github.com/repos/palantir/gradle-java-distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/gradle-java-distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/gradle-java-distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/gradle-java-distribution/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/gradle-java-distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/gradle-java-distribution/merges","archive_url":"https://api.github.com/repos/palantir/gradle-java-distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/gradle-java-distribution/downloads","issues_url":"https://api.github.com/repos/palantir/gradle-java-distribution/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/gradle-java-distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/gradle-java-distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/gradle-java-distribution/labels{/name}","releases_url":"https://api.github.com/repos/palantir/gradle-java-distribution/releases{/id}","deployments_url":"https://api.github.com/repos/palantir/gradle-java-distribution/deployments","created_at":"2015-08-26T00:03:55Z","updated_at":"2016-02-02T06:14:57Z","pushed_at":"2016-02-20T10:59:19Z","git_url":"git://github.com/palantir/gradle-java-distribution.git","ssh_url":"git@github.com:palantir/gradle-java-distribution.git","clone_url":"https://github.com/palantir/gradle-java-distribution.git","svn_url":"https://github.com/palantir/gradle-java-distribution","homepage":"","size":123,"stargazers_count":5,"watchers_count":5,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51"},"html":{"href":"https://github.com/palantir/gradle-java-distribution/pull/51"},"issue":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/51"},"comments":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/gradle-java-distribution/statuses/2d33e7fc0739e1f8149cd25f9858f66b9f31f5b8"}}}}