{"action":"created","issue":{"url":"https://api.github.com/repos/jarib/childprocess/issues/97","labels_url":"https://api.github.com/repos/jarib/childprocess/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/jarib/childprocess/issues/97/comments","events_url":"https://api.github.com/repos/jarib/childprocess/issues/97/events","html_url":"https://github.com/jarib/childprocess/issues/97","id":122248634,"number":97,"title":"Ability to stop a detached child process","user":{"login":"hferentschik","id":296354,"avatar_url":"https://avatars.githubusercontent.com/u/296354?v=3","gravatar_id":"","url":"https://api.github.com/users/hferentschik","html_url":"https://github.com/hferentschik","followers_url":"https://api.github.com/users/hferentschik/followers","following_url":"https://api.github.com/users/hferentschik/following{/other_user}","gists_url":"https://api.github.com/users/hferentschik/gists{/gist_id}","starred_url":"https://api.github.com/users/hferentschik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hferentschik/subscriptions","organizations_url":"https://api.github.com/users/hferentschik/orgs","repos_url":"https://api.github.com/users/hferentschik/repos","events_url":"https://api.github.com/users/hferentschik/events{/privacy}","received_events_url":"https://api.github.com/users/hferentschik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-15T11:10:49Z","updated_at":"2015-12-22T22:23:30Z","closed_at":null,"body":"I am basically trying to figure out how to stop a child process, if it is detached from the parent?\r\nI cannot call `Process.stop` since I don't have a handle to the Process instance anymore. One would need a way to somehow create a Process from a pid. So maybe this is related to #57?\r\n\r\nI tried to use `Process.pid` and save it to a pidfile and then stop/kill the process via\r\n\r\n     ...\r\n     pgid = -Process.getpgid(pid)\r\n     Process.kill(\"INT\", pgid)\r\n     ...\r\n\r\nThis works fine for Linux, but won't work on Windows, since there `Process.getpgid` is not implemented.\r\nWhat would I do on Windows or am I missing something obvious?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jarib/childprocess/issues/comments/166749693","html_url":"https://github.com/jarib/childprocess/issues/97#issuecomment-166749693","issue_url":"https://api.github.com/repos/jarib/childprocess/issues/97","id":166749693,"user":{"login":"jarib","id":572,"avatar_url":"https://avatars.githubusercontent.com/u/572?v=3","gravatar_id":"","url":"https://api.github.com/users/jarib","html_url":"https://github.com/jarib","followers_url":"https://api.github.com/users/jarib/followers","following_url":"https://api.github.com/users/jarib/following{/other_user}","gists_url":"https://api.github.com/users/jarib/gists{/gist_id}","starred_url":"https://api.github.com/users/jarib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarib/subscriptions","organizations_url":"https://api.github.com/users/jarib/orgs","repos_url":"https://api.github.com/users/jarib/repos","events_url":"https://api.github.com/users/jarib/events{/privacy}","received_events_url":"https://api.github.com/users/jarib/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T22:23:30Z","updated_at":"2015-12-22T22:23:30Z","body":"Not really sure how to do exactly what you're asking on Windows. \r\n\r\nOne solution would be to not detach from the process until right before your program exits. Childprocess only provides a way to control detachment before launching the process, but you could still use `Process.detach` to detach later (presumably also on Windows).\r\n\r\nDetaching from a process is basically telling the process \"I don't care about you from now on\". If you need to kill it later, that means you still care and shouldn't have detached from it. \r\n"}}