{"action":"created","comment":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/171393535","pull_request_review_id":100238959,"id":171393535,"diff_hunk":"@@ -315,28 +325,31 @@ function Enter-Studio {\n     New-PSDrive -Name \"Habitat\" -PSProvider FileSystem -Root $env:HAB_STUDIO_ENTER_ROOT | Out-Null\n     mkdir $env:HAB_STUDIO_ENTER_ROOT\\hab\\sup\\default -Force | Out-Null\n     \n-    $pr = New-Object System.Diagnostics.Process\n-    $pr.StartInfo.UseShellExecute = $false\n-    $pr.StartInfo.CreateNoWindow = $true\n-    $pr.StartInfo.RedirectStandardOutput = $true\n-    $pr.StartInfo.RedirectStandardError = $true\n-    $pr.StartInfo.FileName = \"hab.exe\"\n-    $pr.StartInfo.Arguments = \"sup run\"\n-    Register-ObjectEvent -InputObject $pr -EventName OutputDataReceived -action {\n-      $Event.SourceEventArgs.Data | Out-File $env:HAB_STUDIO_ENTER_ROOT\\hab\\sup\\default\\out.log -Append -Encoding ascii\n-    } | Out-Null\n-    Register-ObjectEvent -InputObject $pr -EventName ErrorDataReceived -action {\n-      $Event.SourceEventArgs.Data | Out-File $env:HAB_STUDIO_ENTER_ROOT\\hab\\sup\\default\\out.log -Append -Encoding ascii\n-    } | Out-Null\n-    $pr.start() | Out-Null\n-    $pr.BeginErrorReadLine()\n-    \n-    # As an industry, this should make us all feel bad\n-    # without this stdin never seems to come back and the PS prompt\n-    # fails to appear and things look like they are hung\n-    Start-Sleep -Milliseconds 100\n-\n-    $pr.BeginOutputReadLine()\n+    $habSvc = Get-Service Habitat -ErrorAction SilentlyContinue\n+    if(!$habSvc -or ($habSvc.Status -eq \"Stopped\")) {\n+      $pr = New-Object System.Diagnostics.Process\n+      $pr.StartInfo.UseShellExecute = $false\n+      $pr.StartInfo.CreateNoWindow = $true\n+      $pr.StartInfo.RedirectStandardOutput = $true\n+      $pr.StartInfo.RedirectStandardError = $true\n+      $pr.StartInfo.FileName = \"hab.exe\"\n+      $pr.StartInfo.Arguments = \"sup run\"\n+      Register-ObjectEvent -InputObject $pr -EventName OutputDataReceived -action {\n+        $Event.SourceEventArgs.Data | Out-File $env:HAB_STUDIO_ENTER_ROOT\\hab\\sup\\default\\out.log -Append -Encoding ascii\n+      } | Out-Null","path":"components/studio/bin/hab-studio.ps1","position":62,"original_position":62,"commit_id":"8082f7048463fb482b385ff0ea47f113fe7b7f25","original_commit_id":"8082f7048463fb482b385ff0ea47f113fe7b7f25","user":{"login":"mwrock","id":655165,"avatar_url":"https://avatars2.githubusercontent.com/u/655165?v=4","gravatar_id":"","url":"https://api.github.com/users/mwrock","html_url":"https://github.com/mwrock","followers_url":"https://api.github.com/users/mwrock/followers","following_url":"https://api.github.com/users/mwrock/following{/other_user}","gists_url":"https://api.github.com/users/mwrock/gists{/gist_id}","starred_url":"https://api.github.com/users/mwrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwrock/subscriptions","organizations_url":"https://api.github.com/users/mwrock/orgs","repos_url":"https://api.github.com/users/mwrock/repos","events_url":"https://api.github.com/users/mwrock/events{/privacy}","received_events_url":"https://api.github.com/users/mwrock/received_events","type":"User","site_admin":false},"body":"yup `out-null` == `/dev/null`","created_at":"2018-02-28T21:38:45Z","updated_at":"2018-02-28T21:38:45Z","html_url":"https://github.com/habitat-sh/habitat/pull/4667#discussion_r171393535","pull_request_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/171393535"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/4667#discussion_r171393535"},"pull_request":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667"}},"in_reply_to_id":171386462},"pull_request":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667","id":171124571,"html_url":"https://github.com/habitat-sh/habitat/pull/4667","diff_url":"https://github.com/habitat-sh/habitat/pull/4667.diff","patch_url":"https://github.com/habitat-sh/habitat/pull/4667.patch","issue_url":"https://api.github.com/repos/habitat-sh/habitat/issues/4667","number":4667,"state":"open","locked":false,"title":"run the supervisor as a service in a windows container studio","user":{"login":"mwrock","id":655165,"avatar_url":"https://avatars2.githubusercontent.com/u/655165?v=4","gravatar_id":"","url":"https://api.github.com/users/mwrock","html_url":"https://github.com/mwrock","followers_url":"https://api.github.com/users/mwrock/followers","following_url":"https://api.github.com/users/mwrock/following{/other_user}","gists_url":"https://api.github.com/users/mwrock/gists{/gist_id}","starred_url":"https://api.github.com/users/mwrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwrock/subscriptions","organizations_url":"https://api.github.com/users/mwrock/orgs","repos_url":"https://api.github.com/users/mwrock/repos","events_url":"https://api.github.com/users/mwrock/events{/privacy}","received_events_url":"https://api.github.com/users/mwrock/received_events","type":"User","site_admin":false},"body":"fixes #4665 \r\n\r\nThis PR addresses an issue with Windows container studios where calling `Get-SupervisorLog` does not actually stream the supervisor log because the event handler loggers are blocked on the waiting `Get-Content` which is all running in the same process. This change causes the supervisor to now run as a windows service which is isolated to its own process and command console. This has several benefits:\r\n\r\n* The supervisor is completely isolated from stream and signal handling in the powershell process. The supervisor cannot intercept control signals from the powershell process inadvertainly killing the supervisor.\r\n* We get some dedicated usage of the Windows-Service package which should help us to catch failures when it is updated.\r\n* We now will need to preload the supervisor package in the docker image creation causing the supervisor to start more quickly in a studio\r\n\r\nSigned-off-by: mwrock <matt@mattwrock.com>","created_at":"2018-02-23T21:49:43Z","updated_at":"2018-02-28T21:38:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"982a9dac414743bc466f421c551b754fbfceeb0c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"baumanj","id":5906042,"avatar_url":"https://avatars2.githubusercontent.com/u/5906042?v=4","gravatar_id":"","url":"https://api.github.com/users/baumanj","html_url":"https://github.com/baumanj","followers_url":"https://api.github.com/users/baumanj/followers","following_url":"https://api.github.com/users/baumanj/following{/other_user}","gists_url":"https://api.github.com/users/baumanj/gists{/gist_id}","starred_url":"https://api.github.com/users/baumanj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baumanj/subscriptions","organizations_url":"https://api.github.com/users/baumanj/orgs","repos_url":"https://api.github.com/users/baumanj/repos","events_url":"https://api.github.com/users/baumanj/events{/privacy}","received_events_url":"https://api.github.com/users/baumanj/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667/commits","review_comments_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667/comments","review_comment_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/issues/4667/comments","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/8082f7048463fb482b385ff0ea47f113fe7b7f25","head":{"label":"habitat-sh:win_studio_as_svc","ref":"win_studio_as_svc","sha":"8082f7048463fb482b385ff0ea47f113fe7b7f25","user":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"name":"habitat","full_name":"habitat-sh/habitat","owner":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2018-02-26T04:36:20Z","pushed_at":"2018-02-28T19:50:40Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":77094,"stargazers_count":1397,"watchers_count":1397,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":224,"mirror_url":null,"archived":false,"open_issues_count":316,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":224,"open_issues":316,"watchers":1397,"default_branch":"master"}},"base":{"label":"habitat-sh:master","ref":"master","sha":"cb78a4d0ba0a371b412b2873e01e5cababb1b96a","user":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"name":"habitat","full_name":"habitat-sh/habitat","owner":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2018-02-26T04:36:20Z","pushed_at":"2018-02-28T19:50:40Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":77094,"stargazers_count":1397,"watchers_count":1397,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":224,"mirror_url":null,"archived":false,"open_issues_count":316,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":224,"open_issues":316,"watchers":1397,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/4667"},"issue":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/4667"},"comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/4667/comments"},"review_comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667/comments"},"review_comment":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/4667/commits"},"statuses":{"href":"https://api.github.com/repos/habitat-sh/habitat/statuses/8082f7048463fb482b385ff0ea47f113fe7b7f25"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mwrock"}}